• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 198
  • Last Modified:

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
0
cool_baba
Asked:
cool_baba
  • 5
  • 3
1 Solution
 
fargoCommented:
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>

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

0
 
fargoCommented:
here are the details of the attributes used in window.open
http://www.javascripter.net/faq/openinga.htm
0
Concerto's Cloud Advisory Services

Want to avoid the missteps to gaining all the benefits of the cloud? Learn more about the different assessment options from our Cloud Advisory team.

 
cool_babaAuthor Commented:
and what about passing parameters?
0
 
fargoCommented:
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>

0
 
cool_babaAuthor Commented:
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.
0
 
fargoCommented:
>> can i retrieve parameters by request.getparameter(); As i couldnot get variable values on jsp page.
where? in target jsp? Sure, as the link is pointing to whateverjsppage.jsp...u can get the appended parameters in this jsp like follows

String param1Value = request.getParameter("param1");
String param2Value = request.getParameter("param2");
String param3Value = request.getParameter("param3");

>>  I would appreciate if you could give me a small example, with one field on html and displaying it on JSP page.
please explain more what exactly do u wish? i couldn't understand it.
0
 
cool_babaAuthor Commented:
Its working.. thanks alot .
0

Featured Post

Free Tool: SSL Checker

Scans your site and returns information about your SSL implementation and certificate. Helpful for debugging and validating your SSL configuration.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

  • 5
  • 3
Tackle projects and never again get stuck behind a technical roadblock.
Join Now