Marco M wrote:
> hi all,
> i have a little doubt:
> i am using Model 2 architecture along with the <jsp:useBean> tag
> in my jsp page, i have <jsp:useBean name="mybean" class="package.TheBean"
> scope="request" />
> i have also <jsp:setProperty name="mybean" property="*" />
> the problem is this:
> the Bean represent an user, with all the various properties such as name,
> surname ecc..
> i must be able to change this information. and store the new
> informations....
>
> using the scope = request, means that, if the page is forwarded to a
> Servlet, the Bean is available in the servlet if i use
> request.getAttribute("mybean") ??
> i don't think so, i have tried so many times that at the end i realized that
> the bean is not available... but i want to be told that is like that..
>
As long as you are using <jsp:forward> to forward, and not response.sendRedirect(),
request attributes should be available through the remainder of the current
request. If you need them to last longer than the current request (or you need to
use sendRedirect for some reason) you should store beans in the session instead.
>
> thanx in advance for your reply
> regards
> marco
Craig
===========================================================================
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