• 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 Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Liutauras Vilda
  • Paul Clapham
Sheriffs:
  • paul wheaton
  • Tim Cooke
  • Henry Wong
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Piet Souris
Bartenders:
  • Mike London

display html markup content via iframe and Spring injection

 
Ranch Hand
Posts: 229
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
 
Bartender
Posts: 10780
71
Hibernate Eclipse IDE Ubuntu
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
 
Sheriff
Posts: 67695
173
Mac Mac OS X IntelliJ IDE jQuery TypeScript Java iOS
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
Sheriff
Posts: 67695
173
Mac Mac OS X IntelliJ IDE jQuery TypeScript Java iOS
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
 
ranger
Posts: 17347
11
Mac IntelliJ IDE Spring
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
 
Consider Paul's rocket mass heater.
reply
    Bookmark Topic Watch Topic
  • New Topic