File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
Win a copy of Clojure in Action this week in the Clojure forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

making all fields empty when i make new transaction

 
Rauhl Roy
Ranch Hand
Posts: 401
Spring
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
hi all,

I have created an application which has 3 .jsps

after colick first.jsp's create button -second.jsp (form)has to that contains some fileds and buttons
to enter


and third one is for confirming the entered values in the second .jsp

problems is

Senario1: I
used MVC (struts)


1-first step: clicked on create button from first.jsp

2-enterd intp second.jsp, filed all the text boxes --- clicked next button

3-entered into third.jsp
, clicked on back button to modify


4-second.jsp is holding all values entered before { this is good} since SCOPE = REQUEST


but the problem lies here:

from the above mentioned 4th step's second.jsp if i go back to first.jsp
again come to second.jsp.. I do not want see the old data entred in second.jsp because this

time i am creating a freash transaction.


can you please tell me solution to this problem.

my idea was:

making second.jsp fileds null .

due to type casting problem i can not writee code along with findForward in firstAction.java

is there any other way to solve this problem easyly?


regards,
Rahul
 
Abhilash George
Greenhorn
Posts: 13
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Well it seems that the scope of the form you are talking of ie the one associated with second page is session and thats why it is retaining across action calls.
The default scope of formbeans is session and not request .
let me know if this helps. If you want to look it in a different way , at the submit of first button you create an object of the formbean , (optional put values inside it) and then put that formbean object in the request.
regards
 
With a little knowledge, a cast iron skillet is non-stick and lasts a lifetime.
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic