Win a copy of Head First Android this week in the Android forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Paul Clapham
  • Ron McLeod
  • Tim Cooke
  • Junilu Lacar
Sheriffs:
  • Rob Spoor
  • Devaka Cooray
  • Jeanne Boyarsky
Saloon Keepers:
  • Jesse Silverman
  • Stephan van Hulst
  • Tim Moores
  • Carey Brown
  • Tim Holloway
Bartenders:
  • Jj Roberts
  • Al Hobbs
  • Piet Souris

can i pass a variable through javascript function to another struts jsp page?

 
Greenhorn
Posts: 5
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I have two jsp pages P1 and P2 . When P1 is invoked it picks the details from the database and displays on the page. The details are displayed in the form of a table with each row having a radio button.
When any radio button is checked and then particular link is pressed say "Preview and Announce Party" then the particular id connected with that radio button is taken and it has to be passed to struts-config form-bean so that i can capture it in another Action class.

My question is can i pass the value of the variable through a javascript function to struts-config.xml . How?

My code is like this

<script type="text/javascript">
function announce()
{
for(i=0;i<document.forms[0].seminarID.length;i++)
{
if(document.forms[0].seminarID[i].checked)
{
val=document.forms[0].seminarID[i].value;
}
document.forms[0].action="/Announce";
document.forms[0].submit();

}
</script>

and this function is called from the code

<html:link href="/Announce.do" onclick="javascript:announce()">Announce Party</html:link>


I am new to Struts framework .
 
Greenhorn
Posts: 15
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi,
For this functionality i think no need to pass any value from jsp to xml. Just pass 'SeminarId" as a query string and get that seminarId from request in controller.

Announce.do?SeminarId=seminarId

Note: I am not sure this will really help you.
 
reply
    Bookmark Topic Watch Topic
  • New Topic