struts-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Caroline Jen <jiapei_...@yahoo.com>
Subject Pass a Variable From JSP via JSP To an Action Servlet
Date Fri, 02 Jul 2004 04:59:37 GMT
I have the value of a variable defined in JSP#1 (JSP#1
is not a form):

   <c:set var="id" value="${articleForm.article}"
scope="session"/>

All the variables, which are defined in JSP#1, are
forwarded to JSP#2.  

JSP#2 is a form.  But, the variable 'id' is not used
in JSP#2.

JSP#2 has a submit button and then, an action servlet
takes over the control.  All the text fields in JSP#2
together with the variable 'id' are forwarded to this
action servlet.

I have two questions:

1. I should put this variable 'id' in the request
scope or the session scope.  Currently, it is in the
session scope.

2. How to retrieve the value of this variable 'id' in
the action servlet? (I do not want to print the value
out.  I want to retrieve the value and store it in a
database.)

   session.getAttribute( "id" ); // returns an object 

-Caroline



		
__________________________________
Do you Yahoo!?
Take Yahoo! Mail with you! Get it on your mobile phone.
http://mobile.yahoo.com/maildemo 

---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
For additional commands, e-mail: user-help@struts.apache.org


Mime
View raw message