It was one of those typical "evil" corporate projects... the conversation went almost verbatim like this...
Executive: "Ok, we need to convert this MS technology-based application to Java."
Me: "Why? It works fine as it is."
Executive: "Because we're an all-Java shop."
Me: "Well, ok, your the boss... it'll take me about four months to analyize it fully and redo it."
Executive: "No. Two weeks."
Me: "Uhhh... ummm... then I'm going to have to cut every corner there is and it's going to be a maintenance nightmare, even worse than it being based on Microsoft technologies since I'm the only one here who knows MS stuff and can do this, hence the reason your talking to me anyway, it's not going to be architected properly because I'll spend all my time just making it work"
Executive: "I don't care. Get it done in two weeks, I don't care about the results, as long as they work."
Me: "Ugh. Fine."
Two weeks later, it was done. A previously MS-based (largely C++ by the way) shoehorned into a Java Struts-based application. But it did work!
If I had known about JSTL back then, I could have saved a few days in there too.
I'll still look for the code for you... I'm not responsible for that thing any more so I'm not sure where it is, but really since the presentation is the part I bet you are most interested in, the JSTL tag Jeff mentioned is almost certainly a preferable option anyway.
-- Frank W. Zammetti Founder and Chief Software Architect Omnytex Technologies http://www.omnytex.com
Vicky wrote:
If you can find code, would be much appreciated.
Thank you all for your responses.
-Vicky --- [EMAIL PROTECTED] wrote:
I'm not sure I still have the code in my archives, I will look, but I actually had cause to tackle a problem just like this.
We had an application written by a consultant that is now long gone. He did it in MS technologies, using XSLT to transform XML to HTML to generate the output to the browser. Basically, some business logic classes execute, generate XML, then an appropriate XSLT is applied to the XML to generate an HTML response.
Well, we're now an all-Java shop (except where we're
not :) ), and so this app had to get converted. Converting the back-end logic proved to be a
relatively simple matter (although the architecture
is poor Strus - lots of logic in the Actions, but
hey, it was quick and easy). I just had each Action
stick the resultant XML in an associated ActionForm,
and also put in the appropriate XSLT (read from a
database) in the form as well.
The presentation layer I didn't want to have to re-write, so what I wound up doing was finding a class that accepts an XML and XSLT string and returns a string of the XML transformed with the XSLT (I don't recall which unfortunately) and I wound up generating the HTML *in a JSP*. In other words, the JSP was pretty much just this:
<html><head><title></title></head><body> <%=MyXMLTransformer.transform(myForm.getXML(), myForm.getXSLT())%> </body></html>
All of the actions forward to this JSP, and that's that.
If you are interested I can try and find some code for you, but I thought just explaining the basic approach might be helpful in and of itself.
-- Frank W. Zammetti Founder and Chief Software Architect Omnytex Technologies http://www.omnytex.com
On Tue, October 19, 2004 2:31 pm, Mark Lowe said:
Now we need to get rid of xsl code and replace it with jsp/struts.
Why do you need to do this?
I'd look for a way of getting the xsl
transformations to happen via
struts and then add any new bits using struts
jsps. If there are any
problems with the xsl and nobody knows how to fix
it then, perhaps
replace with JSP. Its hard without knowing the
details, but would seem
wrong..
Mark
On 19 Oct 2004, at 20:22, Vicky wrote:
Hello all,
In my current project we are using xsl which
renders
xml into xhtml. Now we need to get rid of xsl
code and
replace it with jsp/struts. Is there an easy
tool/way
to migrate xsl files into jsps? This is quite
huge
project so it won't be possible to start it from scratch. Any pointes or help would be
appreciated.
Thanks,
_______________________________ Do you Yahoo!? Declare Yourself - Register online to vote today! http://vote.yahoo.com
---------------------------------------------------------------------
To unsubscribe, e-mail:
[EMAIL PROTECTED]
For additional commands, e-mail:
[EMAIL PROTECTED]
---------------------------------------------------------------------
To unsubscribe, e-mail:
[EMAIL PROTECTED]
For additional commands, e-mail:
[EMAIL PROTECTED]
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail:
[EMAIL PROTECTED]
_______________________________ Do you Yahoo!? Declare Yourself - Register online to vote today! http://vote.yahoo.com
--------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
--------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]