Granny's Programming Pearls
"inside of every large program is a small program struggling to get out"
JavaRanch.com/granny.jsp
  • 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 all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Paul Clapham
  • Bear Bibeault
  • Liutauras Vilda
  • Devaka Cooray
Sheriffs:
  • Knute Snortum
  • Junilu Lacar
  • Henry Wong
Saloon Keepers:
  • Ron McLeod
  • Stephan van Hulst
  • Tim Moores
  • Carey Brown
  • Tim Holloway
Bartenders:
  • salvin francis
  • Frits Walraven
  • Piet Souris

Journal Article - Embrace Writing Script-less JSP

 
Sheriff
Posts: 7023
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
The just-released August 2004 edition of The JavaRanch Journal includes an article by Bear Bibeault, "Embrace Writing Script-less JSP".

Please use this thread to comment on and discuss the article.
[ August 26, 2004: Message edited by: Dirk Schreckmann ]
 
Ranch Hand
Posts: 305
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
When I first arrived at the Ranch, my JSP pages were rather ugly, socially-inept creatures with bodies full of Java scriplets, business logic, and everything else including the kitchen sink. I'm happy to report that I've made the transition to JSTL, and how proud I am to look at the finely-polished, handsome new JSPs I've created. Bear is right on, and you, new JSP programmer, do yourself a favor, READ BEAR'S ARTICLE. Learn the right way to do things from the start, it makes the process a whole lot healthier.

And to Bear, thanks. You've been a great help in my transition from sloppy, newbie code, to stream-lined professional-grade applications.
 
Greenhorn
Posts: 24
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Really nice article. In the summary it catches in one sentence the crusial insight to get a nice structure of the web tier.

I think it is worth pointing out that the philosophy is not restricted to JSP 2.0, it is even more important if you want your structure to make sence if you are restricted to, say JSP 1.2 + Struts.
 
Greenhorn
Posts: 2
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator


In a scriptless JSP this is a problem because even though we can obtain the names of the scoped variables as an EL-friendly enumeration (using ${pageContext.servletContext.attributeNames}), you must make a call to a method that takes the name as a parameter in order to obtain the value. And that is something that the EL cannot do.2

2 Someone is sure to point out that with JSTL 1.1 it is possible...


Congratulations: you are gifted with second sight!

Alas, as the evil PageContext doen not have this EL friendly enum it does not work there.

Jan
 
He's giving us the slip! Quick! Grab this tiny ad!
Java file APIs (DOC, XLS, PDF, and many more)
https://products.aspose.com/total/java
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!