Andy:
What "scope" do you use in the usebean tag in your jsp? If, for example, you
set the values for your bean and save it in your session, then you should set
the scope within the usebean tag as "session". I don't use the useBean tag in
my jsps, so am not certain, but it seems as if your page.jsp is using page
scope maybe and therefore creating a new one with default values..?
So try this: In your servlet, change your bean as you want using your form
values. Then set a session attribute like so:
mySession.setAttribute("myBean", myBean);
Then forward to your page.jsp. In page.jsp use your usebean tag as usual but
also specify the scope using "scope="session"..
Regards,
Geeta
Andy Engle wrote:
> Hi all,
>
> I have a question that seems like it should be a no-brainer, but I
> can't seem to get to work: I have a JavaBean in my web application
> that I want to access (and modify values of, of course) from a servlet.
> I have tried several different approaches but I can't get my values
> set in the servlet to appear in the JSP page I am forwarding to.
>
> Here is the general layout of what I am trying to do:
>
> JSP "page.jsp" (which has a usebean tag in it) submits a form to a
> servlet. The servlet does stuff with the data passed in, and then in
> the servlet I am attempting to set some values stored in the bean.
> From there, the servlet forwards back to "page.jsp", where I am using
> that same bean to attempt to retrieve the data set in the servlet. I am
> developing in NetBeans 3.5, and using Tomcat 4.0.6 to serve the stuff.
>
> Like I said earlier, I can't something so seemingly simple to work. If
> any of you have any ideas or maybe some web sites I could refer to I'd
> appreciate it.
>
> Thanks!
>
> Andy
>
> ___________________________________________________________________________
> To unsubscribe, send email to [EMAIL PROTECTED] and include in the body
> of the message "signoff SERVLET-INTEREST".
>
> Archives: http://archives.java.sun.com/archives/servlet-interest.html
> Resources: http://java.sun.com/products/servlet/external-resources.html
> LISTSERV Help: http://www.lsoft.com/manuals/user/user.html
___________________________________________________________________________
To unsubscribe, send email to [EMAIL PROTECTED] and include in the body
of the message "signoff SERVLET-INTEREST".
Archives: http://archives.java.sun.com/archives/servlet-interest.html
Resources: http://java.sun.com/products/servlet/external-resources.html
LISTSERV Help: http://www.lsoft.com/manuals/user/user.html