struts-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Sri Sankaran" <Sri.Sanka...@sas.com>
Subject RE: Submitting to the same JSP
Date Sat, 14 Dec 2002 15:35:12 GMT
Please ensure that your action is indeed *forwarding* and not *redirecting*.  As you know,
in the latter case a new request is created when the client (browser) redirects effectively
dropping 'pv' from the original request.

I don't understand why you are testing for the presence of 'pv' and then redundantly defining
the same bean.

What are the results of testing for the presence of 'pv' anyway?  Is it there?

Hopefully this jogs something.

Sri

-----Original Message-----
From: Harshal D [mailto:emailtoharshal@yahoo.com] 
Sent: Friday, December 13, 2002 3:28 PM
To: Struts Users Mailing List
Subject: RE: Submitting to the same JSP 



Yes I am doing:
JSP-1 -> Action-1 -> JSP-1
Action handler class:

ProductVO pv = new com.openstack.struts.testapp.ProductVO();

pv.setProductID("AH");



request.setAttribute("pv", pv);

In JSP:

<logic:present parameter="pv">

<bean:define id="pv" name ="pv" scope="request" type="com.openstack.struts.testapp.ProductVO"/>

</logic:present>

 

 

And then 

 

 

<logic:present parameter="pv">

<h3><bean:write name="pv" property="productName"/></h3>

<h3><bean:write name="pv" property="productID"/></h3>

</logic:present>

</body>

 

 

The action forwards to the same page but the ProductVO  is NOT defined as a form bean.

 

Where am I going wrong ?

 Sri Sankaran <Sri.Sankaran@sas.com> wrote:Can you please elaborate? Are you saying
that the following works

JSP-1 -> Action-1 -> JSP-2

but 

JSP-1 -> Action-1 -> JSP-1

doesn't. Make sure that you are referring to the bean with the same id under which you have
saved it (to request/session). Can you post the relevant JSP (both JSP-1 and JSP-2), the action
class (how the bean being persisted, how the user is forwarded/re-directed to next view) and
the struts-config (the action mapping).

Please post only the relevant portions.

Sri

-----Original Message-----
From: Harshal D [mailto:emailtoharshal@yahoo.com] 
Sent: Thursday, December 12, 2002 11:07 PM
To: struts-user@jakarta.apache.org
Subject: Submitting to the same JSP 



In my app when I create a bean in action class and display it in the next JSP (forwarded)
it works.

But if I try to display in the same JSP (at the bottom of original form) - it does not work,

I am using tags to make sure bean is created (submit has happened) before displaying its properties.
But that part never gets displayed.



Any thoughts ?



- Harshal.



---------------------------------
Do you Yahoo!?
Yahoo! Mail Plus - Powerful. Affordable. Sign up now

--
To unsubscribe, e-mail: 
For additional commands, e-mail: 



---------------------------------
Do you Yahoo!?
Yahoo! Mail Plus - Powerful. Affordable. Sign up now

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


Mime
View raw message