aspose file tools*
The moose likes Struts and the fly likes how to call a specific  action Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Soft Skills this week in the Jobs Discussion forum!
JavaRanch » Java Forums » Frameworks » Struts
Bookmark "how to call a specific  action " Watch "how to call a specific  action " New topic
Author

how to call a specific action

naveen kk
Greenhorn

Joined: Nov 07, 2007
Posts: 3
Hi All,

I have 2 struts config.xml files in my application. In that two config xmls , I have an action name called "getrecords". How to call a specific action from my html/jsp page.

Please assist me.

Naveen
David Newton
Author
Rancher

Joined: Sep 29, 2008
Posts: 12617

I'm not sure what you mean by "call an action from your JSP page" -- why would you want to?

Is the <s:action> tag not sufficient? (Although I don't really recommend its use.)
naveen kk
Greenhorn

Joined: Nov 07, 2007
Posts: 3
We are using struts 1.2 version only.

I have form like this in my jsp.



<FORM action="success.do" method="post">
----
---
</FORM>


I am having two struts config files

struts-config.xml

<struts-config>
<data-sources />
<form-beans />
<global-exceptions />
<global-forwards />
<action-mappings>
<action path="/success" type="org.apache.struts.actions.ForwardAction"
forward="/completed.jsp"/>
</action-mappings>
<message-resources parameter="com.yourcompany.struts.ApplicationResources" />
</struts-config>



another config file



<struts-config>
<data-sources />
<form-beans />
<global-exceptions />
<global-forwards />
<action-mappings>
<action path="/success" type="org.apache.struts.actions.ForwardAction"
forward="/sample.jsp"/>
</action-mappings>
<message-resources parameter="com.yourcompany.struts.ApplicationResources" />
</struts-config>



In that form which action will be executed either in first or second config xml action. If so why? How to call a specific action from a specific config file
David Newton
Author
Rancher

Joined: Sep 29, 2008
Posts: 12617

Please UseCodeTags when posting code or configuration. Unformatted code and configuration is very difficult to read. You can edit your post to include them by using the button.

If you have two actions with the same name then your application is fundamentally broken. Are you using modules?
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: how to call a specific action