This week's book giveaway is in the Agile and other Processes forum.
We're giving away four copies of The Mikado Method and have Ola Ellnestam and Daniel Brolund on-line!
See this thread for details.
The moose likes JSP and the fly likes recurring JSP problem Big Moose Saloon
  Search | Java FAQ | Recent Topics
Register / Login


Win a copy of The Mikado Method this week in the Agile and other Processes forum!
JavaRanch » Java Forums » Java » JSP
Reply Bookmark "recurring JSP problem" Watch "recurring JSP problem" New topic
Author

recurring JSP problem

Dan Murphy
Ranch Hand

Joined: Mar 29, 2005
Posts: 126
Hi,

Here's an example of the kind of problem I have all the time with JSPs:

I have a Date object stored as a request-scoped attribute. In the web-page itself I want to show something like:

Year 1978, Month 6, Day 30

Extracting these fields in Java code is trivial, but how do I do it in a JSP without resorting to scriptlet code? I can't use a static method and call it via EL, because there's no way to pass parameters to these methods. I suppose I could write my own tag library, but that seems like an awful lot of trouble for something so simple, any suggestions?

(BTW, if anyone knows of a tag library that already provides the date functionality required, please let me know.)

Thanks in Advance,
Dan


SCJP, SCJD, SCWCD
Anirvan Majumdar
Ranch Hand

Joined: Feb 22, 2005
Posts: 261
I think it might just be possible to achieve what you want using JSTL. Perhaps this site may be of some assistance in this regard.
 
I agree. Here's the link: http://zeroturnaround.com/jrebel - it saves me about five hours per week
 
subject: recurring JSP problem
 
Similar Threads
JSF like Struts?
Transforming URL
Tag files in JAR
Struts 2: Iterator/Valuestack question.
JSP library using JSF