File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
The moose likes Struts and the fly likes Request Value getting retained Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Murach's Java Servlets and JSP this week in the Servlets forum!
JavaRanch » Java Forums » Frameworks » Struts
Bookmark "Request Value getting retained" Watch "Request Value getting retained" New topic
Author

Request Value getting retained

Pandian Ramaiah
Greenhorn

Joined: Mar 04, 2010
Posts: 5
Hi,
I use a simple web application that uses struts2 (view)- tiles (view) - Spring - Hibernate.
It is working fine. I have a strange behaviour explained below.

1. Consider I have form. I fill up the text boxes, select boxes and press Submit. The values are getting displayed. Perfect!
2. If I go to any other page and coming to the previous page again. The old values given are still retained by default and results are displayed as per the earlier selection.
3. This condition became worse when I have a try to insert records being fetched in the form. The records are getting duplicated with incremented IDs in database.

Hope I am clear to you. Do you know what could be causing this issue?

Thanks in advance
David Newton
Author
Rancher

Joined: Sep 29, 2008
Posts: 12617

Not without knowing more details. My first assumption would be that you're defining your actions in the Spring config file and not making them prototype scope.
Pandian Ramaiah
Greenhorn

Joined: Mar 04, 2010
Posts: 5
Hi David,
Thanks for your comments. Sorry I am a new bie.

here is my struts.xml declaration

<action name="comparisonAction" class="comparisonAction">
<result name="SUCCESS" type="tiles">comparison</result>
</action>



This is my spring context config

<bean id="comparisonAction" class="com.grassfield.lic.view.ComparisonAction">
<property name="licService" ref="licService" />
</bean>


Thanks
David Newton
Author
Rancher

Joined: Sep 29, 2008
Posts: 12617

My initial assumption was correct.
Pandian Ramaiah
Greenhorn

Joined: Mar 04, 2010
Posts: 5

Great. Thanks David! it worked!
David Newton
Author
Rancher

Joined: Sep 29, 2008
Posts: 12617

Glad to hear you figured it out!
 
Consider Paul's rocket mass heater.
 
subject: Request Value getting retained
 
Similar Threads
A query
not able to retained the value of Drop Down on a page sumbit.
search from list.
Two forms in a page problem
Submitted Form values are repeated across