Hi;

    Maybe I will say a stupidity but, normally the useBean will :
        Verify if in the specified scope object (session object or request object
...) there is an object of type FormProcessor and with the name
sample. In your case you should use the same instance in page formtest.jsp and
more_result.jsp but in th page result.jsp, a new instance of your instance !!!
Now,a question could be which insrtance is used in the jsp:setProperty and
getProperty  ... But anyway, if you have created a bean with session scope, why
don't you use this objet ! why do you use scope request after... Once you have
created a session scope bean it will exist until you specifically remove it
(session.removeAttribute()) or session expires. So if it exist it should be simpler
to use it !?  or did i miss something

    Regards
Veronique


Rick Reumann a �crit :

> This still is not working. In the following you'll see three very
> short pieces of code. What I don't understand is how come I can not
> use <jsp:getProperty name="beanname" property="propname"/> to pull
> stuff out of a session bean? It pulls the information out of the bean
> but these values were not correctly updated from the previous page
> that has request scope and should have set the values based on the
> form submission. I was under the impression that if the bean has
> matching set and get methods that match the form value names that the
> bean would automatically be updated? If someone could look at the
> following code I'd much appreciate it (very short). Everything works
> fine until you get to the more_results page. This page for some
> reason does not have the values that were set in the form. any help
> much appreciated. THanks.
>
> ****1st Page. formtest.jsp  ********
>
> <%@ page import = "FormProcessor" %>
> <jsp:useBean id="sample" class="FormProcessor" scope="session" />
> <HTML><FORM ACTION="results.jsp" METHOD="post">
> Name:<INPUT TYPE="text" NAME="name" VALUE=""> <BR>
> Phone:<INPUT TYPE="text" NAME="phone" VALUE="">  <BR>
> <INPUT TYPE="submit" VALUE="Submit"><BR>
> </FORM></HTML>
>
> **** 2nd page form is submitted to. results.jsp ******
>
> <%@ page import = "FormProcessor" %>
> <jsp:useBean id="sample" class="FormProcessor" scope="request">
> </jsp:useBean>
> <jsp:setProperty name="sample" property="*"/>
> <HTML>
> NAME:<font face="arial"><jsp:getProperty name="sample"
> property="name"/></font><BR>
> PHONE:<jsp:getProperty name="sample" property="phone"/><BR><BR>
> <a href="more_results.jsp">more results</a>
> </HTML>
>
> **** 3rd page more_results.jsp - not giving me the correct values
> submitted by the form.*******
>
> <%@ page import = "FormProcessor" %>
> <jsp:useBean id="sample" class="FormProcessor" scope="session">
> </jsp:useBean>
> <HTML>
> More Results<BR>
> Name:<font face="arial"><jsp:getProperty name="sample"
> property="name"/></font><BR>
> Phone:<jsp:getProperty name="sample" property="phone"/><BR>
> </HTML>
>
> ****END *****
>
> thanks
>
> On 22 Aug 2000, at 18:42, Vishu G wrote:
>
> > 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).
> >
> >
> >
>
> ===========================================================================
> 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

Reply via email to