• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

New window using struts action

 
Ranch Hand
Posts: 173
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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.
 
pie sneak
Posts: 4727
Mac VI Editor Ruby
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I don't think the server can force a new window.

I believe you'll have to declare target='_blank' from the browser.
 
Sheriff
Posts: 6450
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Like Mark said,

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

will open the action called by the link in a new window.
 
Ranch Hand
Posts: 96
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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
 
Sheriff
Posts: 17644
300
Mac Android IntelliJ IDE Eclipse IDE Spring Debian Java Ubuntu Linux
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

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.
 
Kinjal Sonpal
Ranch Hand
Posts: 96
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Thanks Junilu, for clearing my doubt.

Regards,
Kinjal Sonpal
 
reply
    Bookmark Topic Watch Topic
  • New Topic