I guess the code inside <jsp:usebean> and </jsp:usebean> is executed only if
that bean is instantiated.for session since that bean might have been
instantiated already,the code inside will not be executed.if you move the
<jsp:setProperty> out of <jsp:usebean> the properties will be set whenever
the page is executed(assuming control reaches it).
-----Original Message-----
From: A mailing list about Java Server Pages specification and reference
[mailto:[EMAIL PROTECTED]]On Behalf Of Rick Reumann
Sent: Tuesday, August 22, 2000 4:07 PM
To: [EMAIL PROTECTED]
Subject: request/session ?
This is really puzzling me..
Is there a way I can use the JSP/bean shortcut of doing, for example:
<jsp:getProperty name="sample" property="name"/> so that the session
bean is also updated with the information? It seems like in order to
do the above I had to set the bean scope to "request" which means
even when I do the following,
<jsp:useBean id="sample" class="cms.SampleBean" scope="request">
<jsp:setProperty name="sample" property="*"/>
</jsp:useBean>
at the top of the page, the session bean is not updated with the
request parameters. It seems like the only way around this is to set
the scope to "session" and then use request.getParameter to get the
values and then set the bean values individually with sample.setName(
request.getParameter("value")) etc.
This involves much more coding since you have to test for null values
in the code etc. There must be a way that the session bean could
automatically be updated by request parameters, what am I missing?
thanks
rick
===========================================================================
To unsubscribe: mailto [EMAIL PROTECTED] with body: "signoff
JSP-INTEREST".
Some relevant FAQs on JSP/Servlets can be found at:
http://java.sun.com/products/jsp/faq.html
http://www.esperanto.org.nz/jsp/jspfaq.html
http://www.jguru.com/jguru/faq/faqpage.jsp?name=JSP
http://www.jguru.com/jguru/faq/faqpage.jsp?name=Servlets
===========================================================================
To unsubscribe: mailto [EMAIL PROTECTED] with body: "signoff JSP-INTEREST".
Some relevant FAQs on JSP/Servlets can be found at:
http://java.sun.com/products/jsp/faq.html
http://www.esperanto.org.nz/jsp/jspfaq.html
http://www.jguru.com/jguru/faq/faqpage.jsp?name=JSP
http://www.jguru.com/jguru/faq/faqpage.jsp?name=Servlets