aspose file tools*
The moose likes Struts and the fly likes New window using struts action Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Frameworks » Struts
Bookmark "New window using struts action" Watch "New window using struts action" New topic
Author

New window using struts action

boyet silverio
Ranch Hand

Joined: Aug 28, 2002
Posts: 173
Suppose I have the following return statement in an action:

return mapping.findForward("target");

"target" is mapped to a jsp page in struts-config.
How can the jsp be displayed in a new window using struts? Thanks in advance.
Marc Peabody
pie sneak
Sheriff

Joined: Feb 05, 2003
Posts: 4727

I don't think the server can force a new window.

I believe you'll have to declare target='_blank' from the browser.


A good workman is known by his tools.
Jason Menard
Sheriff

Joined: Nov 09, 2000
Posts: 6450
Like Mark said,

<html:link page="/myAction.do" target="_blank">

will open the action called by the link in a new window.
Kinjal Sonpal
Ranch Hand

Joined: Jun 06, 2003
Posts: 96
Friends,

I have a question on the similar lines. I've also encountered similar situation. I used a simple JavaScript function to fire off an action in a new window. Since, the menu, toolbar etc. was not supposed to be shown, I had to use this solution(though it's only to fool lay people ).

How far do you think, this solution can be accepted? Though this works for me for the time being, I'm sure 1) there are better ways to do it 2) This approach does not seem to have it's proper roots.

Please share your thoughts on this.

Thanks and regards,
Kinjal Sonpal
Junilu Lacar
Bartender

Joined: Feb 26, 2001
Posts: 5018
    
    8

Originally posted by Kinjal Sonpal:

How far do you think, this solution can be accepted? Though this works for me for the time being, I'm sure 1) there are better ways to do it 2) This approach does not seem to have it's proper roots.


Why do you say it doesn't have "proper roots"? Sure, it may seem ugly but that's the best that you can do, really. As mentioned/alluded to above, "windowing" is a client-side function. The server process really doesn't have anything to do with it.


Junilu - [How to Ask Questions] [How to Answer Questions]
Kinjal Sonpal
Ranch Hand

Joined: Jun 06, 2003
Posts: 96
Thanks Junilu, for clearing my doubt.

Regards,
Kinjal Sonpal
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: New window using struts action