You are viewing a plain text version of this content. The canonical link for it is here.
Posted to taglibs-user@tomcat.apache.org by Shawn Bayern <ba...@essentially.net> on 2002/08/08 19:39:11 UTC

Re: How can I access JSP variables from the JSTL tag

On Thu, 8 Aug 2002, Dave Anand wrote:

> I have sQID , qType, sACODE  defined as String in the JSP Sscript.
> I am having trouble accessing them within the JSLT tag, I tried pageContext,
> pageScope, and just ${qType}  nothing seem to
> work, I just get blanks.
> 
> 
>  <% out.println("QUESTION_ID=" +sQID + "  QUESTION_TYPE="+ qType+ "
> ANSWER_CODE="+ sACODE + "<br>") ;%>
> 
>    <c:out value="QUESTION_ID=${pageContext.sQID}
> QUESTION_TYPE=${pageContext.qType} ANSWER_CODE=${pageContext.sACODE}" />
> <br>

This just came up on the taglibs-user mailing list.  You need to insert
the values into the PageContext manually, as in

 pageContext.setAttribute("sQID", sQID);

In JSP, tags cannot access local page variables.

-- 
Shawn Bayern
"JSTL in Action"   http://www.jstlbook.com


--
To unsubscribe, e-mail:   <ma...@jakarta.apache.org>
For additional commands, e-mail: <ma...@jakarta.apache.org>