struts-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Mohiit <>
Subject Re: How to open a page in new window with <s:a> or <s:url> tag?
Date Wed, 16 Apr 2008 05:38:58 GMT

I myself found the solution.
To open link in the new window, do as it is mentioned below.

<s:url id='abc' action='xyz'></s:url>
<s:a href='#' onclick="javascript:window,open('%{abc}');">test</s:a>

this is working for me. I hope this solution can help you guys also. =) 

Mohiit wrote:
> I am using Struts 2. I want to open the page in the new window when I
> click
> on an icon. I am using <s:a> tag and giving action by <s:url> tag.
> i.e., <s:url id='abc' action='xyz'>,/s:url>
>        <s:a href='%{abc}'></s:a>
> This way it is opening an action in same page. I want it in the new window
> like in HTML tag we can do it by                         link .
> What is the way in struts 2 for this..?

Struts 2's s:a tag doesn't support this. The solution is to use a 
combination of s:url and a vanilla HTML anchor tag:

   <s:url id='abc' ...

View this message in context:
Sent from the Struts - User mailing list archive at

To unsubscribe, e-mail:
For additional commands, e-mail:

View raw message