Win a copy of Design for the Mind this week in the Design forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Display String in new window

 
mike stewart
Greenhorn
Posts: 6
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Sheriff
Pie
Posts: 20945
31
Eclipse IDE Firefox Browser MySQL Database
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 6
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Sheriff
Pie
Posts: 20945
31
Eclipse IDE Firefox Browser MySQL Database
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 6
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic