Win a copy of Murach's Python Programming this week in the Jython/Python forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic

to get the session value in the JSTL Expression Language  RSS feed

 
Mothea Anil Kumar
Greenhorn
Posts: 22
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I have a session value() which I am able to get in the class file Navigationtag.java.

In this code the session value is in a string FK.
String FK=(String)pageContext.getSession().getAttribute("facilityKey");
out.print("FK"+FK);

but I have to display the session value in a searchbox with the code
input type=\"text\" size=\"9\" maxlength=\"8\" value=\"'$FK'\" name=\"searchbox\"/

Here the session value is not displayed instead it is taking the string '$FK' and displaying on the browser.I need the value to be displayed.
 
Srikanth Nutigattu
Ranch Hand
Posts: 114
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
EL will work only in a JSP page,
It is not $FK it should be ${facilityKey}.

Thanks.

Cheers!
[ December 11, 2008: Message edited by: Srikanth Nutigattu ]
 
Mothea Anil Kumar
Greenhorn
Posts: 22
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
thank you srikanth..

anyways..I have just kept value = \"" + FK + "\" and it worked..
 
sudipto shekhar
Ranch Hand
Posts: 826
Chrome Eclipse IDE Oracle
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
What you say can be done always.
The answer that Srikanth gave you satisfies your question.


 
Bear Bibeault
Author and ninkuma
Marshal
Posts: 65826
134
IntelliJ IDE Java jQuery Mac Mac OS X
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
"Anil", please check your private messages for an important administrative matter.
 
It is sorta covered in the JavaRanch Style Guide.
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!