PDA

View Full Version : How to set a session object using tags


cash1981
07-12-2007, 05:55 PM
Hello. I want the equivalent code for

<% session.setAttribute("someText", Object) %>
In JSP tag.

I think I can use
<c:set var="advertiseList" value="${advertises}" scope="session" />

But this doesnt work. Any suggestions?

pooter8d
07-13-2007, 05:44 AM
i dont see why you would want to make something so simple more complicated.. but perhaps creating your own custom tag that has the

pageContext.getSession().setAttribute("text", object);

the only thing is that i'm not sure if it is possible to pass objects through a custom tag.. just Strings me thinks... but give it a try :)

cash1981
07-13-2007, 08:48 AM
Thats my problem. I cannot send an object through a custom tag.