aspose file tools*
The moose likes Struts and the fly likes passing value from one JSP to another JSP through JavaScript  Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Spring in Action this week in the Spring forum!
JavaRanch » Java Forums » Frameworks » Struts
Bookmark "passing value from one JSP to another JSP through JavaScript  " Watch "passing value from one JSP to another JSP through JavaScript  " New topic
Author

passing value from one JSP to another JSP through JavaScript

San Smith
Greenhorn

Joined: Feb 10, 2008
Posts: 14
Can you help me?

I am trying to pass a value through this hyperlink. (Example: www.abc.com?value=1). I have following existing code. I just need to pass "value=1" end of the link from page1.JSP and I want to retrieve this value to page2.JSP (e.g. request.getParameter("value") . Can you please help me how I can pass "value=1" through the JavaScript function. I tried different way but did not work.

<html:link href="javascript:XXX('A');"> Link </html:link>


function XXX(A) {
document.MyForm.abc.value = A;
document.MyTypeForm.submit();
}

Thank you
rajan Kayarohanam
Greenhorn

Joined: Jan 24, 2008
Posts: 12
Hi Smith,

Passing value from a JSP to another JSP using javascriopt can be done by methods in dhtml.
For Ex : consider there are 2 JSP's JSP1 and JSP2. in the JSP1 have a hidden variable and in the hidden variable onchange event call a function.

in the JSP2 ,

And in the JSP 1 when the value changes the onchange js function will be called and in the function take the hidden variable value and do the manipulation....

Hope i answered to YOUR question...

Regards,
KMR
 
Don't get me started about those stupid light bulbs.
 
subject: passing value from one JSP to another JSP through JavaScript