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

Questions on Struts

 
Mike Yu
Ranch Hand
Posts: 175
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi,

I am new to Struts. I have some questions that may be simple to you.
(1) How do you validate user input in Struts?
(2) What uniquely identifies an Action element, for example, name, path or something else?
(3) Does the reset in ActionForm set properties to the initial values or to the request parameters?
 
John Smith
Ranch Hand
Posts: 61
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
You can validate in the validate method and return an error if the data is invalid.

The reset method should be used to reset checkboxes only as their state is only forwarded on a submit if they are checked.

You should initialise your stuff within action classes, see my posting here:
http://www.coderanch.com/t/49471/Struts/action-class
 
Jeanne Boyarsky
author & internet detective
Marshal
Posts: 33694
316
Eclipse IDE Java VI Editor
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Mike,
2) The path is what needs to be unique. You can the same action class servicing several types of requests by changing the form bean or forward.
 
I agree. Here's the link: http://aspose.com/file-tools
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic