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 "Chaimungkalanot, Mark " <ma...@cba.com.au> on 2003/11/05 23:53:54 UTC

Accessing the Temp Var in a c:forEach

Guys,

As much as I loathe to do it, I need to access the value within the temp
variable created by c:forEach in a scriptlet.

Is this possible?

Basically I have a non-bean standard object that I need to get stuff out of
(object.getAttribute(key) sort of object). I don't seem to be able to use
c:out to do this, so I was thinking of using scriptlets instead

Cheers

MC


**************   IMPORTANT MESSAGE  **************
This e-mail message is intended only for the addressee(s) and contains information which may be confidential. If you are not the intended recipient please advise the sender by return email, do not use or disclose the contents, and delete the message and any attachments from your system. Unless specifically indicated, this email does not constitute formal advice or commitment by the sender or the Commonwealth Bank of Australia (ABN 48 123 123 124) or its subsidiaries.
**************************************************


---------------------------------------------------------------------
To unsubscribe, e-mail: taglibs-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: taglibs-user-help@jakarta.apache.org


Re: Accessing the Temp Var in a c:forEach

Posted by Brice Ruth <br...@fiskars.com>.
You might try exposing a variable with the attribute 'var' or 
'varStatus' - either of those may help you ... put those in your 
c:forEach clause, then see what they contain by accessing 
pageContext.getAttribute("yourVarName") from your scriptlet ... where 
'yourVarName' is whatever name you chose to expose 'var' or 'varStatus' 
with.

Chaimungkalanot, Mark wrote:

>Guys,
>
>As much as I loathe to do it, I need to access the value within the temp
>variable created by c:forEach in a scriptlet.
>
>Is this possible?
>
>Basically I have a non-bean standard object that I need to get stuff out of
>(object.getAttribute(key) sort of object). I don't seem to be able to use
>c:out to do this, so I was thinking of using scriptlets instead
>
>Cheers
>
>MC
>
>
>**************   IMPORTANT MESSAGE  **************
>This e-mail message is intended only for the addressee(s) and contains information which may be confidential. If you are not the intended recipient please advise the sender by return email, do not use or disclose the contents, and delete the message and any attachments from your system. Unless specifically indicated, this email does not constitute formal advice or commitment by the sender or the Commonwealth Bank of Australia (ABN 48 123 123 124) or its subsidiaries.
>**************************************************
>
>
>---------------------------------------------------------------------
>To unsubscribe, e-mail: taglibs-user-unsubscribe@jakarta.apache.org
>For additional commands, e-mail: taglibs-user-help@jakarta.apache.org
>
>  
>

-- 
Brice D. Ruth
Sr. IT Analyst
Fiskars Brands, Inc.



---------------------------------------------------------------------
To unsubscribe, e-mail: taglibs-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: taglibs-user-help@jakarta.apache.org


Re: Accessing the Temp Var in a c:forEach

Posted by Konstantin Shaposhnikov <k8...@tut.by>.
On 09:53 Thu 06 Nov     , Chaimungkalanot, Mark  wrote:
> Guys,
> 
> As much as I loathe to do it, I need to access the value within the temp
> variable created by c:forEach in a scriptlet.
> 
> Is this possible?

You could do that in the following way:
  <c:forEach items="${items}" var="t">
    <%
      Object t = pageContext.getAttribute("t");
      ///...
    %>
  </c:forEach>

best regards,
Konstantin

  

---------------------------------------------------------------------
To unsubscribe, e-mail: taglibs-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: taglibs-user-help@jakarta.apache.org