I have a JSP page with some sciptlets.
<% String myname = "";
pageContext.setAttribute("myname",myname);
%>
<c:set var="myname" value="sherlok" />
Now I have copied the value "sherlok" to variable myname.
I can see the setting by
set value is: <c:out value='${myname}'/>
This works fine as it prints out jstl variable myname.
But below statement doesnt work.
set value is: <%=myname%>
How can I get the value into a java variable from a jstl variable?
-Regards,
spa
shaji - 17 Jan 2006 12:57 GMT
FYI:
Solution is:
Depending upon the context of the binding of jstl variable, you can
get the value from the appropriate context.
Mainly they are application, request, session and page
In my case it was page:
<% String myname = pageContext.getAttribute("myname"); %>
-thanks