jsp <c:out> - question

C

ctyberg

I'm trying to re-write this line using c:eek:ut.
<%request.setAttribute( "view", session.getAttribute("EntityReport"));
%>

I know that my object is there because the line below works. I see my
object's class name...
<c:eek:ut value="${sessionScope.EntityReport}"/>

Then I assign it to the variable "view".
<c:set var="view" scope="request"
property="${sessionScope.EntityReport}"/>

But then I can't see it anymore. The line below does not show the
object's class name.
View: <c:eek:ut value="${view}"/>

Any ideas?
 
R

Ryan Stewart

ctyberg said:
I'm trying to re-write this line using c:eek:ut.
<%request.setAttribute( "view", session.getAttribute("EntityReport"));
%>

I know that my object is there because the line below works. I see my
object's class name...
<c:eek:ut value="${sessionScope.EntityReport}"/>

Then I assign it to the variable "view".
<c:set var="view" scope="request"
property="${sessionScope.EntityReport}"/>

But then I can't see it anymore. The line below does not show the
object's class name.
View: <c:eek:ut value="${view}"/>

Any ideas?
Try value instead of property in the set tag.
 
C

ctyberg

Thank you! It worked.

Here's my next question.

I want to get an object from the session, but I need to refer to the
object by using a request parameter. How would I do it?

<c:set var="varName" scope="request" value="${param.varName}"/>
<c:set var="view" scope="request"
value="${sessionScope.WouldLikeToPutVarNameHere}"/>
 
M

Murray

ctyberg said:
Thank you! It worked.

Here's my next question.

I want to get an object from the session, but I need to refer to the
object by using a request parameter. How would I do it?

<c:set var="varName" scope="request" value="${param.varName}"/>
<c:set var="view" scope="request"
value="${sessionScope.WouldLikeToPutVarNameHere}"/>

sessionScope[varName]
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,770
Messages
2,569,584
Members
45,075
Latest member
MakersCBDBloodSupport

Latest Threads

Top