Win a copy of Mesos in Action this week in the Cloud/Virtualizaton forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Calling Action method using struts-tags

 
Kevin P Smith
Ranch Hand
Posts: 362
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 9521
22
Android Google Web Toolkit Hibernate IntelliJ IDE Java Spring
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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...
 
David Newton
Author
Rancher
Posts: 12617
IntelliJ IDE Ruby
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
The <s:url> tag has a "method" attribute.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic