• 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

Trouble Passing Parameters From Session

 
Greenhorn
Posts: 15
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I need to be able to take a parameter from my session and display it in a s:text tag.

I have a properties file that I am able to get static messages from with no problem. My assumption is that (like Struts 1.x validation and Java's printf command), that I should be able to use some type of escape characters that will allow me to imbed parameters in the messages. I suspect it would look something like the following example, where you would just need to supply some text to fill in the dates, assuming the session variables are strings.



In the JSP, my assumption would be that I could use that message by adding s:param tags inside my s:text tag, like the following example.



The page would show something like this...

The sales event will be held from July 1st through July 5th.




I've tried adding the % sign and curly-braces, and not having them. I seem to get either nulls (even though I can display the dates I want on the page with a s:property tag), or either see the stuff shown here in the curly-braces showing up exactly as shown.

Any idea what is missing or wrong?



 
Ranch Hand
Posts: 99
Tomcat Server Java Linux
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Expression language work with prefix ${}, not %


-Mauro.
 
Robert Eugene
Greenhorn
Posts: 15
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
The solution that worked for me ended up being a little more simple. It appears that I did not need the containing curly braces or the dollar/percent sign prefix.

 
Don't get me started about those stupid light bulbs.
reply
    Bookmark Topic Watch Topic
  • New Topic