This week's book giveaway is in the Kotlin forum.
We're giving away four copies of Kotlin in Action and have Dmitry Jemerov & Svetlana Isakova on-line!
See this thread for details.
Win a copy of Kotlin in Action this week in the Kotlin forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic

making all fields empty when i make new transaction  RSS feed

Rauhl Roy
Ranch Hand
Posts: 401
  • 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

is there any other way to solve this problem easyly?

Abhilash George
Posts: 13
  • 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.
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!