We help IT Professionals succeed at work.

Using <jsp:forward> to open Page in New window

mikesung99 used Ask the Experts™

I'm experimienting with using <jsp.foward> to navigate to another page (and pass over some attributes). The following is a snippet of the code that I've been testing:-

             <jsp:forward page="DailyBarChart.jsp">
                    <jsp:param name="DailyStats"
                     value="<%= DailyStats %>" />                  
                    <jsp:param name="sCurrentDate"
                     value="<%=sCurrentDate %>" />

The above code works fine in that it will open up DailyBarChart.jsp in the same browser instance (and pass over the two attributes of DailyStats and sCurrentDate).

 However, I would like to open up the page in a seperate window - Is this possible - I've searched the various forums and web but I cannot as yet find anything to point me in the right direction.

Many Thanks


Watch Question

Do more with

Expert Office
EXPERT OFFICE® is a registered trademark of EXPERTS EXCHANGE®


Just to clarify, I need to open up the DailyBarChart.jsp page in a new window and also pass over the 2 attributes.
You don't want to use a forward.  You need to use javascript. See example code below.    
     function popup(){
      window.open("<%=request.getContextPath()%>/DailyBarChart.jsp?DailyStats=<%= DailyStats %>&sCurrentDate=<%=sCurrentDate%>","mywindow");
<body onload="popup();">
This page has opened(or tried to open) a window for your other page. It may have been blocked by pop-up blocker.

Open in new window