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

Display String in new window

mike stewart
Greenhorn

Joined: Jun 22, 2011
Posts: 6
I have a action class that does some logic and returns an xml document in the form of a String. I would like to, instead of displaying the xml with <s:property value="xmlResponse"/>, display the String in a new window so that Internet Explorer will format the String (also, I need it to display in a new window so formatting it to display in the current window wont work for me). I am using struts 2 and need to call the new window from a jsp page. Thank you for any help you can give!
Paul Clapham
Bartender

Joined: Oct 14, 2005
Posts: 18991
    
    8

When you say "a new window", does that mean a new browser window? Because you can only send the response back to the place where the request came from. If you want the request to show up in a new window, then the HTML in the browser has to ask for that.

(This isn't specific to Struts, it applies to all HTTP requests.)
mike stewart
Greenhorn

Joined: Jun 22, 2011
Posts: 6
Yes, I do mean new broswer window. How would I specify in html that I want my String to be displayed in a new window? Thanks for the help.
Paul Clapham
Bartender

Joined: Oct 14, 2005
Posts: 18991
    
    8

Sorry, I never remember that either, I always have to google "html new window"; here's the first link I got for that: Link to New Window.
mike stewart
Greenhorn

Joined: Jun 22, 2011
Posts: 6
Thanks, that solves one problem. My main problem is how am I going to populate that new window with only a string (in the struts2 framework in a JSP). I don't mean inbetween <p> </p> tags, but by itself so IE will format the xml string in the correct way. Also, can I put "target = _blank" in my struts.xml? I don't think I can but ill try when I get back home. Thanks for your help Paul.
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Display String in new window