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 Similar Action mappings in two xml files but parameters different? Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Frameworks » Struts
Bookmark "Similar Action mappings in two xml files but parameters different?" Watch "Similar Action mappings in two xml files but parameters different?" New topic
Author

Similar Action mappings in two xml files but parameters different?

Arjun Reddy
Ranch Hand

Joined: Nov 10, 2007
Posts: 629
Hi All,

I am looking at two struts xml files with names struts-login.xml and struts-config.xml with similar action mappings except for the parameter attributes which is different. So what exactly does this mean? What is the usage of the parameter attribute and what’s the usage of having similar action mappings in different xml files with just the parameter attribute different?

Thanks.

Be Humble... Be Nice.
David Newton
Author
Rancher

Joined: Sep 29, 2008
Posts: 12617

The "parameter" attribute is used in dispatch actions and controls which action method will be called.
Arjun Reddy
Ranch Hand

Joined: Nov 10, 2007
Posts: 629
David Newton wrote:The "parameter" attribute is used in dispatch actions and controls which action method will be called.


Thanks for replying David. I have a question though. Does the type attribute have to be something like type="org.apache.struts.actions.DispatchAction" then? Because, the type attribute in the struts xml files I see are like com.login.LoginSubmitAction. DispatchAction is not mentioned anywhere.



David Newton
Author
Rancher

Joined: Sep 29, 2008
Posts: 12617

...

Maybe it's a subclass; I have no way of knowing.
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Similar Action mappings in two xml files but parameters different?