• Post Reply Bookmark Topic Watch Topic
  • New Topic

New Article: Constant Constants Consternation  RSS feed

 
Ernest Friedman-Hill
author and iconoclast
Sheriff
Posts: 24215
37
Chrome Eclipse IDE Mac OS X
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
The latest entry in our own butter-fingered but beloved Bear Bibeault's "Scriptless JSP Pages" series, entitled "Constant Constants Consternation", appears in the latest issue of the JavaRanch Journal. You kin check out that there article here. Y'all have anything to say about it? Say it right in this thread!
 
Ben Souther
Sheriff
Posts: 13411
Firefox Browser Redhat VI Editor
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Careful, Bear. You keep writin em like that and someone's likely to bind em up with a perty cover and throw a big-ol-buncha money atcha.

Seriously great job.




[Happy Groundhog Day]
 
Ray Millard
Greenhorn
Posts: 1
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
This is great stuff! Do you have a jar file for JSP 1.2? Some of us are not yet on JSP 2.0.

Thanks!!!
 
Bear Bibeault
Author and ninkuma
Marshal
Posts: 65833
134
IntelliJ IDE Java jQuery Mac Mac OS X
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi Ray, thanks for the feedback.

But no, I don't have a JSP 1.2-compliant version lying around.

The code should be sufficiently straight-forward and commented enough for you to be able to create a JSP 1.2 version (minus the EL function, of course, which is only possible under JSP 2.0). But then, "everything is easy to the person who doesn't have to do the work".

If you do take this on, I'm sure I can get it hosted here (with appropriate credit of course).
 
Brent Sterling
Ranch Hand
Posts: 948
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I realize that I am a little late to the party...Sharing constants between Java code and JSP code without using scriptlets is something that I have been trying to figure out for a while so you can imagine that I was excited to stumble across the article.

I am stuck with JSP 1.2 because of the version of Oracle Application Server that I am using. The article seems to imply that some of the concepts shown can be applied to JSP 1.2. All right!! As I stepped back and started thinking about how I could integrate this into my application I became confused. Most of the article is about using EL instead of scriptlets to access constants, but EL is not a feature of JSP 1.2. I guess it might be possible to pass in constants to JSTL tags but I do not see how I could use this for other tag libraries. Am I missing something?

- Brent
 
Bear Bibeault
Author and ninkuma
Marshal
Posts: 65833
134
IntelliJ IDE Java jQuery Mac Mac OS X
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
In JSP 1.2 (my condolences), the EL is limited to values of JSTL tag attributes. But you should be able to employ this in that scenario. To be honest I forget what other changes might be necessary off the top of my head. Perhaps you could give it a try and post any errors you encounter?
 
Brent Sterling
Ranch Hand
Posts: 948
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
If it is only going to work for JSTL tags then that will not help me out much. The two places where I would use this most are in a tag library that I use for pagination and AjaxAnywhere tags (my current task). Unfortunately I might be stuck with OC4J 10.1.2 for a while.

- Brent
 
Bear Bibeault
Author and ninkuma
Marshal
Posts: 65833
134
IntelliJ IDE Java jQuery Mac Mac OS X
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
With JSP 1.2 you are pretty much stuck with using scriplets outside of the JSTL tags. That's independent of the constants sub-system discussed here as the EL was not introduced into general JSP usage until JSP 2.0.
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!