Hi,
I'm building a STRUTS application and I have a results page which iterates through a number or rows. On each row it places a checkbox.
I have an onClick event which invokes a javascript function to ensure only 1 row is ever checked.
I then have a button which picks up the selected row and places it's ID on the URL and posts the form. It looks a bit like:
<SCRIPT LANGUAGE="JavaScript" >
function do_submit(action) {
var number = getChecked();
document.myform.action=action + number;
}
</SCRIPT>
The resulting URL then looks like:
The struts-config.xml has a mapping like so:
<action path="/classresults"
type="xx.xxx.xxx.xxxx.action.ClassResultsAction"
parameter="id"
validate="false">
<forward name="success" path="/classresults.jsp" />
</action>
The problem I have is in the action class (ClassResultsAction) I want to know what the ID is. If I look in the debugger there is crap all in the request stack and there is no form or anything available.
As you can see I tried using 'parameter' option hoping it would pass the variable in. But it didn't
I dont really want to use a form to make my 1 variable available to the Action class, is there any other way I can pass my variable in ?
I'm building a STRUTS application and I have a results page which iterates through a number or rows. On each row it places a checkbox.
I have an onClick event which invokes a javascript function to ensure only 1 row is ever checked.
I then have a button which picks up the selected row and places it's ID on the URL and posts the form. It looks a bit like:
<SCRIPT LANGUAGE="JavaScript" >
function do_submit(action) {
var number = getChecked();
document.myform.action=action + number;
}
</SCRIPT>
The resulting URL then looks like:
The struts-config.xml has a mapping like so:
<action path="/classresults"
type="xx.xxx.xxx.xxxx.action.ClassResultsAction"
parameter="id"
validate="false">
<forward name="success" path="/classresults.jsp" />
</action>
The problem I have is in the action class (ClassResultsAction) I want to know what the ID is. If I look in the debugger there is crap all in the request stack and there is no form or anything available.
As you can see I tried using 'parameter' option hoping it would pass the variable in. But it didn't
I dont really want to use a form to make my 1 variable available to the Action class, is there any other way I can pass my variable in ?