Win a copy of Murach's Python Programming this week in the Jython/Python forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic

"Professional JSP Tag Libraries"  RSS feed

 
Rick Rodriguez
Ranch Hand
Posts: 44
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I have never "won" anything in my life, and I don't expect to win the book here, but I wanted to ask a really dumb question:
Why JSP? What is special about a Java Server Page, over an Active Server Page.
As you can see, I have a lot of reading up to do.
 
Ruilin Yang
Ranch Hand
Posts: 150
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
JSP has a big drawback is that it has to use a heavy-weight web server (Weblogic, WebSphere, JRun, TomCat, etc.) in comparison with ASP, which use IIS/PWS included in Windows system as a module. If you have Windows OS you are OK with no extra worries. Basically, JSP and ASP server the same purpose for users.
 
Zac Roberts
Ranch Hand
Posts: 82
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Rick - JSP is great because it allows you to take advantage of basically the entire Java Programming Language in a web based environment to create dynamic content and applications.
Ruilin - I wouldn't exactly call Tomcat a "heavy-weight" web server. It is a good JSP/Servlet container that isn't very difficult to get up and running on any platform. Also, ASP forces the developer and system admin into the Microsoft black hole which isn't always a great place to be.
 
Pete Cassetta
Greenhorn
Posts: 23
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Originally posted by Rick Rodriguez:
Why JSP? What is special about a Java Server Page, over an Active Server Page.

Rick,
I've been programming in JSP/Servlets for about a year and a half. For me, the main advantages over ASP are as follows:
1) You don't have to host on a Microsoft platform. I've had serious stability, security, and reliability problems hosting on Microsoft stuff.
2) You can program in Java, rather than Visual Basic/C++/C#. Of course, if you don't like Java, or don't have Java expertise, this point is moot. But I do like Java a lot. There is an unbelievable wealth of pre-written code in the Java libraries, which enables me to write less code that is more elegant and more focused on the problem domain. Also, with the traditional ASP route, you wrote your ASP code in Jscript or VBScript, then you wrote your components in C++. That was a mess. With JSP everything you write is in Java. I'm not a fan of mixing languages, but obviously Microsoft pitches this as a benefit in .NET where you can do it all in C# (or other languages).
3) JSP offers you a wealth of prewritten code in the form of the J2EE libraries (JavaMail, DOM, SAX, etc.), tag libraries (Apache Taglibs and JSTL for starters, but there are many other open-source and commercial libraries out there), and frameworks (Struts is the most popular, but again there are at least 20 excellent open source Web frameworks available - see
The Wafer Project). Some of these are traditional frameworks, while some like wingS and Echo mimic the familiar Swing programming model.
 
Romin Irani
Greenhorn
Posts: 3
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I have used both ASP and JSP. The plus points for me as far as JSP were concerned was
a) The Java language
b) Excellent Open Source Projects
The above two options presents the developer with more options.
Ofcourse the bottom line is that from a business perspective if the application addresses the business need, you shouldnt be too worried about ASP or JSP.
 
Frank Jiang
Greenhorn
Posts: 4
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I am a newbie for JSP. I am t5aking a web developing class using Tomcat and JBoss, of couse JSP. We are going to use mySQL as database.
Can anybody recommend some links of professional code examples? I bought a book from Wrox "Beginning JSP". I found the code written by different authors are quite different.
Does JSP have some kind of code standard like JavaDoc?
Thanks
Frank
 
Pete Cassetta
Greenhorn
Posts: 23
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Originally posted by Frank Jiang:
Can anybody recommend some links of professional code examples? I bought a book from Wrox "Beginning JSP". I found the code written by different authors are quite different.
Does JSP have some kind of code standard like JavaDoc?

Frank,
I'd say the consensus among professional developers is that you don't really want to embed any Java code in JSP's at all. At least, no more than is necessary.
To accomplish this, you put your real logic in JavaBeans that get used in JavaServer pages, and repetitive items can be handled via standard (open source or commercial) or custom (write them yourself) tag libraries. I would hope your course will highlight these matters. Whether or not it does, please acquaint yourself with the JSTL. You can download it from Jakarta. There are a bunch of good tutorials on tag libraries here: tag library tutorials
Here's a long list of JSP sites; some are excellent:
JSP Sites
 
Simon Brown
sharp shooter, and author
Ranch Hand
Posts: 1913
6
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I totally agree with Pete on this one - for reasons around maintainability and reusability, it's best not to place too much Java code in your JSPs. Business logic should be placed in components such as JavaBeans (or even EJBs) whilst presentation related logic should ideally be placed in custom tags. Of course, presentation logic can also be placed inside JavaBeans, and for a dicussion and examples of when this is a bad idea, check out Chapter 8 : Tag Patterns (including a dicussion of Custom Tags vs. JavaBeans) which is available to download in PDF format for free.
Cheers
Simon
 
Doug Wang
Ranch Hand
Posts: 445
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Originally posted by Romin Irani:
I have used both ASP and JSP. The plus points for me as far as JSP were concerned was
a) The Java language
b) Excellent Open Source Projects
The above two options presents the developer with more options.
Ofcourse the bottom line is that from a business perspective if the application addresses the business need, you shouldnt be too worried about ASP or JSP.

Romin hits it! The reason I am for JSP lies in many excellent open source projects and its continuous evolution.
 
chanoch wiggers
Author
Ranch Hand
Posts: 245
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
i've been writing with struts (jsp tag framework) and I can say that it has changed my coding altogether - stuff takes longer to develop but the maintenance is a breeze - seriously. It takes me a tenth of the time. Plus I genuinly think twice before putting actual java code in a jsp now - that has improved even finding the code for fixing greatly.
chanoch
 
Sanjay Jadhav
Ranch Hand
Posts: 86
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hello...
I want to know about tablibs with other java technology other than JSP, I know tablibs is part of JSP spec but if tablibs get totally seperated from jsp then they it will be much more useable.
for e.g. simple application want to access data then you have to code for same, but if u have tablibs already developed then it become possible to get direct object with JNDI Name. Means if tablibs are isolated from jsp then most of code is reduce.
This is regarding more reusability and portability.
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!