You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@struts.apache.org by chenshibing <ch...@lifeisgreat.com.cn> on 2008/03/06 09:35:21 UTC

Open A New Page In the Server Side

Hi, all:

I have a question to ask: is it possible to open a new browser page in the server side instead of using form.target="__blank"?

User submits a form then the server side codes do some validations. If the form valid, a new page is return for printing, or the original page is returned with some prompt messages. But if the form's target attribute set to __blank, it will open new page in both situations. Is there any response header to control browser open new page in the server side?

-- 
Best regards, 

Shibing Chen




---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
For additional commands, e-mail: user-help@struts.apache.org


[OT] Re: Open A New Page In the Server Side

Posted by Antonio Petrelli <an...@gmail.com>.
2008/3/6, chenshibing <ch...@lifeisgreat.com.cn>:
>
> Hi, all:
>
> I have a question to ask: is it possible to open a new browser page in the
> server side instead of using form.target="__blank"?
>
> User submits a form then the server side codes do some validations. If the
> form valid, a new page is return for printing, or the original page is
> returned with some prompt messages. But if the form's target attribute set
> to __blank, it will open new page in both situations. Is there any response
> header to control browser open new page in the server side?



I think that you can accomplish it with a mix of Javascript and server
logic.
You could make an AJAX call (e.g. with DWR) and then, depending on a
parameter, you could open a window or redirect to another page.
This is just a "proof of concept", not real code, but at least it is a step
forward :-)

Antonio