This week's book giveaway is in the Servlets forum.
We're giving away four copies of Murach's Java Servlets and JSP and have Joel Murach on-line!
See this thread for details.
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


Win a copy of Murach's Java Servlets and JSP this week in the Servlets forum!
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: 627
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: 627
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?
 
Similar Threads
struts 1: message resources can't be found
Struts starting problems.
error starting struts app in tomcat
how to call a specific action
Doubt regarding action class