• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

Servlet best practices

 
Ranch Hand
Posts: 30
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi
I've been given the unfortunate task of building a web site using servlets and a third party templating technology. That means JSPs are strictly out. Can anyone point me in the direction of some documentation on building java apps using purely servlets. There must be some best practices for this kind of thing.
Thanks
 
Ranch Hand
Posts: 3695
IntelliJ IDE Java Ubuntu
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Turn that frown upside down!! hehe.

Not being able to use JSPs is not the end of the world. If the 3rd party templating stuff is Velocity, then I'd start to smile. I've used it before a few times and have loved it always, and haven't missed JSP at all. The rest of this post assumes that by "JSPs are strictly out" you mean "I have a presentation layer OTHER THAN servlets" (that being: the templating technology you spoke of).

As for tutorials on model-2, I admit I've always been dismayed by the utter *lack* of good ones. The one tutorial on servlets, and JUST sevlets on java.sun.com is from 1996. Everyone always seems so gung-ho about talking about Model-2, but then when it comes time to do some samples, they always run back to doing JSP pages. That is: they ignore their own advice.

A much more recent one is the J2EE tutorial,
found here but this is much more than just servlets, and it contains a lot of implementation details regarding the RI J2EE server. Let's not even go there!

Other links I've found, with varying usefullness:
http://www.javaworld.com/javaworld/jw-12-1999/jw-12-ssj-jspmvc.html
Very dated, ignore everything that makes mention of a jswdk, or that makes you go "Well DUH!" (like the last sentence in the 'So What's Wrong With Servlets?' section)
http://www.stardeveloper.com/articles/display.html?article=2001060501&page=1
This is an entire chapter from Professional JSP 2nd Edition on using JSP/Servlets/Beans in a MVC (model2) architecture. Decent reading, just translate any of their JSP stuff into your templating technology.

http://www.onjava.com/pub/a/onjava/excerpt/jebp_3/index1.html
That last one seems more up your alley, and has the added benefit of being recent!

And no discussion of this sort should leave out a mention of frameworks.
struts While struts has a JSP taglib and recommends JSP for view layer.. in reading their docs you'll probably gather a lot of good information on model2.
 
Mike Curwen
Ranch Hand
Posts: 3695
IntelliJ IDE Java Ubuntu
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
one last one "from the source"
http://developer.java.sun.com/developer/technicalArticles/javaserverpages/servlets_jsp/
 
With a little knowledge, a cast iron skillet is non-stick and lasts a lifetime.
reply
    Bookmark Topic Watch Topic
  • New Topic