aspose file tools*
The moose likes Spring and the fly likes display html markup content via iframe and Spring injection Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Spring in Action this week in the Spring forum!
JavaRanch » Java Forums » Frameworks » Spring
Bookmark "display html markup content via iframe and Spring injection" Watch "display html markup content via iframe and Spring injection" New topic
Author

display html markup content via iframe and Spring injection

sam White
Ranch Hand

Joined: Feb 18, 2011
Posts: 208
Hi, I want to display a product description , but the description is has html mark up codes.
I tried to use iframe to achieve that, but iframe require src=external.html.
Since I don't want to create an external.html for every description, how can I use iframe or other method to display my product description with html market up content?

Any suggestion is very much appreciated.
Thanks
Sam
Winston Gutkowski
Bartender

Joined: Mar 17, 2011
Posts: 8008
    
  22

sam White wrote:Hi, I want to display a product description , but the description is has html mark up codes.

I'm way out of my depth here, not being a GUI expert, but if this is a swing application, I believe JTextField allows html markup.

How much I have no idea though.

And if this is Web-based, surely it can already deal with the markup?

Winston

Isn't it funny how there's always time and money enough to do it WRONG?
Articles by Winston can be found here
Bear Bibeault
Author and ninkuma
Marshal

Joined: Jan 10, 2002
Posts: 61433
    
  67

So is this a web app or what is it?


[Asking smart questions] [Bear's FrontMan] [About Bear] [Books by Bear]
sam White
Ranch Hand

Joined: Feb 18, 2011
Posts: 208
Bear Bibeault wrote:So is this a web app or what is it?


It is a web app.
I know I can display the html content without iframe, but it will mess up the existing web design.
Considering the html content inside a iframe is only a product description which is published by user, it is a bad idea to allow user to alter the hosting webpage design.
Thanks
Sam
sam White
Ranch Hand

Joined: Feb 18, 2011
Posts: 208
Assuming the html content is stored in a database, how to display the html content (with html tags) src in iframe after retrieved it from database?
Thanks
Sam
Bear Bibeault
Author and ninkuma
Marshal

Joined: Jan 10, 2002
Posts: 61433
    
  67

If you want to use an iframe, the HTML will need to be in another document.
sam White
Ranch Hand

Joined: Feb 18, 2011
Posts: 208
Bear Bibeault wrote:If you want to use an iframe, the HTML will need to be in another document.

Is there other way that I can display the html using spring injection?
eg. when displaying image, we use
likewise, in iframe,
I want to display html content with: <iframe src="/product/description/productId"></iframe>
I have tested this, it is unsuccessful. Spring doesn't know how to "wire" iframe with spring injection...

Thanks
Sam
Mark Spritzler
ranger
Sheriff

Joined: Feb 05, 2001
Posts: 17257
    
    6

Spring dependency injection is JVM objects injected into other JVM objects.

You could do a simple AJAX call to a REST service that returns the HTML and then insert it into the DOM with javascript. Just have a holder for the html.

Mark


Perfect World Programming, LLC - Two Laptop Bag - Tube Organizer
How to Ask Questions the Smart Way FAQ
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: display html markup content via iframe and Spring injection