aspose file tools*
The moose likes XML and Related Technologies and the fly likes jsp or xsl Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Engineering » XML and Related Technologies
Bookmark "jsp or xsl" Watch "jsp or xsl" New topic
Author

jsp or xsl

ashok ganesan
Ranch Hand

Joined: Jan 02, 2007
Posts: 50
hi all ,
i m just trying to develop a simple database management application following the mvc pattern . for presentation part i m bit confused to use either jsp or xsl. i just need to know the difference between the two in their performance ,scalability , simplicity . so accordingly i could choose the language to use.
if someone could help me out .

thanks in advance
ashok
Paul Clapham
Bartender

Joined: Oct 14, 2005
Posts: 18541
    
    8

I have done applications both ways. I don't know about performance or scalability because they weren't high-volume applications. I would suggest that JSP is more intuitive for web applications than XSLT is, and also that you will find more people who are proficient in JSP than in XSLT to do the work.
Lasse Koskela
author
Sheriff

Joined: Jan 23, 2002
Posts: 11962
    
    5
I'd strongly recommend JSP over XSL. The latter can easily become an unmaintainable, complex mess and writing the XSL stylesheets isn't the easiest of tasks in the first place...


Author of Test Driven (2007) and Effective Unit Testing (2013) [Blog] [HowToAskQuestionsOnJavaRanch]
Bear Bibeault
Author and ninkuma
Marshal

Joined: Jan 10, 2002
Posts: 60997
    
  65

I'm in the JSP camp. The only reasons I have ever used XSL over JSP is when the same data needs to be renderred in enough different formats that it made the headaches of XSL worthwhile.

For just delivering web application pages, using XSL is like hitting yourself in the forehead with a hammer -- completely needless.

And, as of JSP 2.0, the few web apps I've written that render XML in differnt formats use JSP with the JSTL XML tags in favor of XSL.


[Asking smart questions] [Bear's FrontMan] [About Bear] [Books by Bear]
Joe Harry
Ranch Hand

Joined: Sep 26, 2006
Posts: 9349
    
    2

Even I prefer to go the jsp way as using XSL for big sized projects or mid sized projects can become messy over a period of time.


SCJP 1.4, SCWCD 1.4 - Hints for you, Certified Scrum Master
Did a rm -R / to find out that I lost my entire Linux installation!
ashok ganesan
Ranch Hand

Joined: Jan 02, 2007
Posts: 50
hi first thanks all for your replies . i m totally amazed that everyone is for jsp and in fact feel that coding in xsl is going to be the toughest job. but is there any one good reason for using xsl. because i have heard that some people still use xsl in their application for their presentation part by rendering the xml returned by controller or model. is that any particular feature that xsl could do but not jsp . and what could have made this people to choose xsl rather than jsp.



thanks all

ashok
Paul Clapham
Bartender

Joined: Oct 14, 2005
Posts: 18541
    
    8

The "model" in a web application typically contains information stored either as session attributes or as request attributes. A JSP has access to those attributes built in, whereas XSLT does not, so you would need extra work to allow XSLT to access the model. So that's something specific in favour of JSP.

What could be an application where XSLT would be not a bad choice? In the application I wrote using XSLT, all of the pages had a common structure. This makes it easy to write a transformation per page, because xsl:include can be used a lot. But such applications are uncommon; they are visually boring and so they can only really be used in places where the users have no choice but to use them.
ashok ganesan
Ranch Hand

Joined: Jan 02, 2007
Posts: 50
hey paul as you said i was just trying some sample program in xsl . all my pages have got same structure like drawing header , result table , placing buttons . i just wrote a common xsl code and using import i could call the particular template for header,table & buttons. and for specific behavior for particular page i just overridden the template in that page alone . so in this case as you said xsl coding is easy and less coding is to be done. but i just want to know if this could be done in jsp or is this kind of coding is not appreciated to do in jsp.




thanks all

ashok
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: jsp or xsl