struts-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Anton Pussep <>
Subject Method prefix with additional parameters
Date Tue, 12 Jun 2007 13:15:11 GMT

I am using method prefix in order to be able to forward the form content
to different methods in my action class. Now I need several buttons that
call all the same method, but a parameter shall tell the method what to
do (e.g. which entry to delete in an ArrayList). Is there a way to pass
a parameter when a button is clicked (but that is not passed, if another
one is clicked)?

Here is a small example illustrating what I would like to do:

<s:iterator value="names">
  <s:property />
  <s:submit name="method:remove" value="Remove" />

When the button behind a name is clicked the action class shall remove
the name from its list. The action class contains an ArrayList of names
and has a getter "public ArrayList getNames() {return names;}"


View raw message