I was wondering if it is possible to give a bean scope both "session"
and "request"?
I have a page called process.jsp which is called after the submission
of a form. In this page I would like to be able to use the jsp
shortcuts of getting the parameters by (this example:)..

text.addLine( text.getText(), text.getFirstName(),
text.getLastName(), text.getNumberOne(), text.getOther(),
text.getEmail() );

This works fine but the problem is when the method addLine in the
bean is called (which updates a vector stored in the bean) the bean
no longer holds the value of the updated vector when I go to the
forwarded page. If I switch the bean scope on this process.jsp page
to "session" it will hold the updated vector, but it then can't
process the request parameters correctly with the shortcut i'm using.
(I know I could change the above method to use
request.getParameter("firstName") etc. and it would work but I'd like
to see if there is a way to do it without doing this).
I'm sure there is something basic I'm missing here, and would love
any help. Thanks.
The following is the complete process.jsp page (not very long).

<%@ page language="java"
import="java.util.*,java.io.*,TextReader,TextReader.PhoneInfo" %>
<jsp:useBean id="text" class="TextReader" scope="request">
        <jsp:setProperty name="text" property="*"/>
</jsp:useBean>
<%
text.addLine( text.getText(), text.getFirstName(),
text.getLastName(), text.getNumberOne(), text.getOther(),
text.getEmail() );
%>
<jsp:forward page="phoneNumber.jsp"/>

..............

"A wise man would pick up a grain of sand and see
the entire universe, a stupid man would get naked,
role in seaweed, and stand up and say, 'Look,
I'm vine man.'"

===========================================================================
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

Reply via email to