Win a copy of Zero to AI - A non-technical, hype-free guide to prospering in the AI era this week in the Artificial Intelligence and Machine Learning forum!
  • 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 all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Liutauras Vilda
  • Paul Clapham
  • Bear Bibeault
  • Jeanne Boyarsky
Sheriffs:
  • Ron McLeod
  • Tim Cooke
  • Devaka Cooray
Saloon Keepers:
  • Tim Moores
  • Tim Holloway
  • Jj Roberts
  • Stephan van Hulst
  • Carey Brown
Bartenders:
  • salvin francis
  • Scott Selikoff
  • fred rosenberger

Display String in new window

 
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!
 
Marshal
Posts: 25927
69
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
Marshal
Posts: 25927
69
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.
 
Morning came much too soon and it brought along a friend named Margarita Hangover, and a tiny ad.
Building a Better World in your Backyard by Paul Wheaton and Shawn Klassen-Koop
https://coderanch.com/wiki/718759/books/Building-World-Backyard-Paul-Wheaton
reply
    Bookmark Topic Watch Topic
  • New Topic