tags:

views:

1458

answers:

0

Hi All, I am working on struts2 application. In a jsp page I have some checkboxes and onclick checkbox page submits. Its working well. See the code below -

<s:form action="authority" method="POST" theme="simple">
<table>
<tr><td><s:checkbox name="originatorName" id="originatorId" value="originatorValue" onclick="submit();"/></td></tr>
<tr><td><s:checkbox name="evaluatorName" id="evaluatorId" value="evaluatorValue" onclick="submit();"/></td></tr>
</table>
</s:form>

Below showing how struts.xml handling the action -

<action name="authority" class="power.AuthorityCheck">
        <result name="input">login.jsp</result>
        <result name="originator">originatorMain.jsp</result>
        <result name="evaluator">evaluatorMain.jsp</result>
</action>

In my action class (AuthorityCheck.java) I am getting the boolean value (true/false) for the checkbox cliked by the user that is coming from "name" attribue of checkbox tag. Now I also need "id" and "value" of that clicked checkbox in my action calss. Can anyone help me to get this ?

Thanks in advance.