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

Problem with ActionForm

 
Anirvan Das
Greenhorn
Posts: 1
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi all,

I am new to struts. I am facing the following problem.
I am trying to add and edit some items from the same jsp page. but the problem is whenever I am editing an item and after that I am trying to add something, insead of adding the new item it is updating the item I edited previously. It seems my ActionForm is holding the previous bean object. I have set the scope to request. I am using DispatchAction.
Following is the excerpt from struts-config.xml fo rdisplay of the add/edit page:


Following is the code from struts-config.xml for submitting the add/edit form:


Following is the excerpt from action class :


Plaese send me any suggestion you may have. I am really lost.
Thanks in advance.

Anirvan
 
Brent Sterling
Ranch Hand
Posts: 948
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Could you expand on "insead of adding the new item it is updating the item I edited previously"? When the page is show are all the fields populated with the previous item?

It might be that you need to add scope="request" to your itemAdd-display action mapping.

- Brent
 
I agree. Here's the link: http://aspose.com/file-tools
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic