This week's book giveaway is in the Jobs Discussion forum.
We're giving away four copies of Customer Requirements for Developers and have Marcho Behler on-line!
See this thread for details.
The moose likes Struts and the fly likes struts link Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login

Win a copy of Customer Requirements for Developers this week in the Jobs Discussion forum!
JavaRanch » Java Forums » Frameworks » Struts
Bookmark "struts link" Watch "struts link" New topic

struts link

Jomy George
Ranch Hand

Joined: Jan 13, 2011
Posts: 68

i have an issue in struts link.
my jsp page holds a form and it use the form variables in it.

one of that variable like

it is fetched and shown correclty in jsp.

now i have to make a link which open this form variable in a pop-up.
i made that link as

is there any way to pass serverurl variable in to this openUrl() method?
i know it is possible by setting it as a request attibute... but i hope there exists some better way to do it.....

thanks in advance for any help.....
pooja par
Ranch Hand

Joined: Feb 14, 2011
Posts: 31
if the openUrl() function is in the same jsp

if you want to pass the value to the popup window
Jomy George
Ranch Hand

Joined: Jan 13, 2011
Posts: 68
thanks pooja..
but its not working in my page
Arjun Murthy

Joined: May 11, 2011
Posts: 10
Try this

<html:text property="serverurl" size="40" id="serverurlid" />

function openUrl(){
var x = document.fgetElementById("serverurlid").value;
Jomy George
Ranch Hand

Joined: Jan 13, 2011
Posts: 68
thanks pooja and arjun

pooja i tested your code in mozilla and it not getting the value.
but after it changed as

var x = document.forms[0].serverurl.value; it works, any way your code is ok in explorer and chrome. thanks

wood burning stoves
subject: struts link
It's not a secret anymore!