Thanks Max,

The links work fine if I'm going straight to a jsp page, but I hit the
Action class before the jsp is rendered and that's why I have this problem.

I was hoping there was a parameter I could include in the forward tag of the
struts-conf.xml file that would open the page in a new browser window, but
such is not the case.

<forward name="success"   path="/reports/assessmentAnalysis.jsp"
target="_blank" />

It was just some wishful thinking on part of something I was trying to do.


-----Original Message-----
From: Max Cooper [mailto:[EMAIL PROTECTED]]
Sent: Wednesday, January 22, 2003 11:58 AM
To: Struts Users Mailing List
Subject: Re: Can Action Forward be used to open a new brower window?


Forwards happen on the server, so there is no simple way to have a forward
pop up in a new window. If the browser makes a request for /showItToMe.do,
you can forward it 1,000 times on the server and it is still just one
request to the browser. And it is going to display the response in whatever
browser window made the request.

However, you can make the action pop up in a new window by changing the
links to that action. This is probably what you want to do. On the page that
has the link to your action, have it render HTML like this:

<a href="/yourContextPath/assessmentAnalysis.do" target="new">Click me</a>

instead of just:

<a href="/yourContextPath/assessmentAnalysis.do">Click me</a>

(Obviously, this is a very simple example. You'll probably want to use
html:link and perhaps even some JavaScript to control the pop-up window's
properties. I am sure there are many resources with details about creating
pop-up windows available on the web.)

I imagine you could also do some kind of response that had both some page
content for the main window, plus a JavaScript to open a new window and
request the other action. But, that would be messy and many people have this
kind of browser functionality disabled to avoid unwanted pop-ups. This is
probably not a good idea.

-Max

----- Original Message -----
From: "Michael Cardon" <[EMAIL PROTECTED]>
To: "Struts Users Mailing List" <[EMAIL PROTECTED]>
Sent: Wednesday, January 22, 2003 10:40 AM
Subject: Can Action Forward be used to open a new brower window?


> I am using struts 1.1 beta 2
>
> I use the DispatchAction object using a display method in the class:
>
> public class AssessmentAnalysisAction extends DispatchAction {
>
> public ActionForward display(ActionMapping mapping,
> ActionForm form,
> HttpServletRequest request,
> HttpServletResponse response) {
>
>    HttpSession session = request.getSession();
> AssessmentAnalysisForm aaf = (AssessmentAnalysisForm)form;
> ActionErrors errors = new ActionErrors();
> int debugLevel = servlet.getDebug();
>
> ... code ....
>
> // Load the form displaying the report data
>    return mapping.findForward("success");
> }
> }
>
> I have mapped the 'success' key to the jsp page in struts-conf.xml
>
> <action    path="/assessmentAnalysis"
>            type="com.mim.struts.reports.AssessmentAnalysisAction"
>            name="assessmentAnalysisForm"
>           scope="request"
>       parameter="dispatch">
>   <forward name="success"   path="/reports/assessmentAnalysis.jsp"/>
> </action>
>
>
> Is what I would really like, is to have the jsp page open in a new brower
> window. Is this possible? Thanks.
>
> Michael Cardon
> [EMAIL PROTECTED]
>
>
> --
> To unsubscribe, e-mail:
<mailto:[EMAIL PROTECTED]>
> For additional commands, e-mail:
<mailto:[EMAIL PROTECTED]>
>
>



--
To unsubscribe, e-mail:
<mailto:[EMAIL PROTECTED]>
For additional commands, e-mail:
<mailto:[EMAIL PROTECTED]>


--
To unsubscribe, e-mail:   <mailto:[EMAIL PROTECTED]>
For additional commands, e-mail: <mailto:[EMAIL PROTECTED]>

Reply via email to