tags:

views:

549

answers:

0

In my struts 2 application I have a jsp (say first.jsp) with following checkboxes -

<td><s:checkbox name="authority" fieldValue="ORIGINATOR"/></td>
<td><s:checkbox name="authority" fieldValue="EVALUATOR"/></td>
<td><s:checkbox name="authority" fieldValue="PURCHASE"/></td>
<td><s:checkbox name="authority" fieldValue="EXTRA"/></td>

Suppose user checked 1st three and submit. Now, in my action I have following getter method -

private String authority;
public String getAuthority() {        
return authority;}
public void setAuthority(String authority){ 
this.authority = authority;}

And this method is returning - ORIGINATOR, EVALUATOR, PURCHASE

Now in some other jsp (say second.jsp) I have same checkboxes like –

<td><s:checkbox name="authority" fieldValue="ORIGINATOR"/></td>
<td><s:checkbox name="authority" fieldValue="EVALUATOR"/></td>
<td><s:checkbox name="authority" fieldValue="PURCHASE"/></td>
<td><s:checkbox name="authority" fieldValue="EXTRA"/></td>

But this time I want by default 1st three checkboxes (that used has checked in previous jsp) should be enabled and fourth should be disabled (that user has not checked in previous jsp).

Please suggest.