Storing an object into a bean

Hi folks,

I've got a JSP in which I want to store the implicitsession object into a bean that I create on the same page. I create the bean with this line:

<jsp:useBean id="slogin" class="iteu.StudentLoginBean" scope="request" />

and the next line is:

<jsp:setProperty name="slogin" property="thesession" param="session" />

This should call the setThesession() method in the bean (which *does* exist) and store the session as an instance variable of the bean. However, I've put a println() inside the setThesession() method and this isn't being called, implying that the method itself isn't being called. I'm not getting any compilation or runtime error, so can anybody help?

Thanks very much in advance,

Raj.

[960 byte] By [rajbhaskar] at [2007-9-26 2:38:37]
# 1

The <jsp:setProperty ...> works with parameters that are submitted with the request - the implicit session object is not a parameter that gets submitted along with your request, so you can't do it this way. You'll have to use normal java coding, i.e., something like this:

<%

slogin.setThesession(session); // store the session object

%>

Make sure that your method 'setThesession(...)' has been declared to accept a session object.

hungyee at 2007-6-29 10:09:44 > top of Java-index,Enterprise & Remote Computing,Web Tier APIs...