aspose file tools*
The moose likes Struts and the fly likes Calling Action method using struts-tags Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of EJB 3 in Action this week in the EJB and other Java EE Technologies forum!
JavaRanch » Java Forums » Frameworks » Struts
Bookmark "Calling Action method using struts-tags" Watch "Calling Action method using struts-tags" New topic
Author

Calling Action method using struts-tags

Kevin P Smith
Ranch Hand

Joined: Feb 18, 2005
Posts: 362
Could anyone tell me how you can call a specific method from an Action using the struts tags?

I have
<%@ taglib prefix="s" uri="/struts-tags" %>
in my JSP and was looking for something like s:link or s:button to call a specific method from the action (say UserAction.edit() or UserAction.delete()) but can not find anythign that works.

Cheers in advance

KS
Ankit Garg
Sheriff

Joined: Aug 03, 2008
Posts: 9280
    
  17

I think you are using Struts 2. In struts 2, while you define an action in your struts.xml file, you can also give the method that you want to be called. So you can define more than one mapping for your action that will call different methods...


SCJP 6 | SCWCD 5 | Javaranch SCJP FAQ | SCWCD Links
David Newton
Author
Rancher

Joined: Sep 29, 2008
Posts: 12617

The <s:url> tag has a "method" attribute.
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Calling Action method using struts-tags
 
Similar Threads
Benefits of using JSF over struts
How to forward radio button input from one jsp to another?
html:submit Vs html:cancel buttons
Getting values from properties in validate-using multiple message-resources in struts
how to call a specific action