Link to home
Create AccountLog in
Avatar of willi_gamboa
willi_gamboa

asked on

JSTL <c:set> tag with <fmt> tag

Hi. I don't know much about JSTL, but someone with some knowledge was trying to help me out. Basically I'm trying to set a variable in JSTL with value equal to something referenced by a <fmt> tag. Then I try to get the value of this variable in a scriptlet through the pageContext. The code below doesn't work, however. All I'm getting is an empty string in the scriptlet. Any help would be appreciated.

      <c:set var="selectedValuePresented" value="<fmt:message key='<%= ResourceKeys.DF_SELECT %>'/>" />

<%
      String selectedValuePresented = String.valueOf (pageContext.getAttribute("selectedValuePresented"));
%>
ASKER CERTIFIED SOLUTION
Avatar of evnafets
evnafets

Link to home
membership
Create a free account to see this answer
Signing up is free and takes 30 seconds. No credit card required.
See answer
SOLUTION
Link to home
membership
Create a free account to see this answer
Signing up is free and takes 30 seconds. No credit card required.
Avatar of willi_gamboa
willi_gamboa

ASKER

Thank you. Both approaches work. Regarding minimizing scriptlet code, I completely agree. However, I'm a front end developer whose focus is on DHTML. So any quick way to get the Java developers' code to work with my front end stuff will work for me.
;)

Glad I could help

David