Link to home
Start Free TrialLog in
Avatar of cool_baba
cool_baba

asked on

Opening JSP in new custom-sized window.

I have three html pages and a JSP page. I want to add a link(could be a form "submit" button) to JSP on each html page so that when user clicks on that link,  JSP page opens on a separate custom-sized browser window with fields values of html page displayed on it.

Thanks
Avatar of fargo
fargo

for opening a custom size window
<a href='' onClick="window.open('/Page.do','_blank','menubar=no,left=50,top=50,height=500,width=1000,scrollbars,resizable=yes');">Link</a>

i assume u are working with struts so, /Page.do
otherwise replace it with, /whateverjsppage.jsp

here are the details of the attributes used in window.open
http://www.javascripter.net/faq/openinga.htm
Avatar of cool_baba

ASKER

and what about passing parameters?
say for example the url to open is "/whateverjsppage.jsp" then u can append parameters as in normal html link like
/whateverjsppage.jsp?param1=value1&param2=value2&param3=value3

then the link will become
<a href='' onClick="window.open('/whateverjsppage.jsp?param1=value1&param2=value2&param3=value3','_blank','menubar=no,left=50,top=50,height=500,width=1000,scrollbars,resizable=yes');">Link</a>

can i retrieve parameters by request.getparameter(); As i couldnot get variable values on jsp page.
 
 I would appreciate if you could give me a small example, with one field on html and displaying it on JSP page.
ASKER CERTIFIED SOLUTION
Avatar of fargo
fargo

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Its working.. thanks alot .