• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

display html markup content via iframe and Spring injection

 
sam White
Ranch Hand
Posts: 229
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Pie
Posts: 10505
64
Eclipse IDE Hibernate Ubuntu
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
 
Bear Bibeault
Author and ninkuma
Marshal
Pie
Posts: 65119
91
IntelliJ IDE Java jQuery Mac Mac OS X
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
So is this a web app or what is it?
 
sam White
Ranch Hand
Posts: 229
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 229
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Pie
Posts: 65119
91
IntelliJ IDE Java jQuery Mac Mac OS X
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
If you want to use an iframe, the HTML will need to be in another document.
 
sam White
Ranch Hand
Posts: 229
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 17278
6
IntelliJ IDE Mac Spring
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic