• 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
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

How do I retrieve HTML popup dialog content from database?

 
Greenhorn
Posts: 17
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I have some mock HTML dialog popping up when I click on a link created with href. How do I direct this HREF to retrive HTML content from a database?

Please let me know. Thanks.
 
Sheriff
Posts: 67746
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
What I'd do: on button click, kick off an Ajax request to fetch the HTML fragment, then use jQuery to insert it into DOM.
 
Kaiser Rahman
Greenhorn
Posts: 17
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Thanks for your reply, but, can you please provide me some sort of example? Regs.
 
Bear Bibeault
Sheriff
Posts: 67746
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
Firstly, I've moved this to the HTML/JavaScript forum as there really isn't any JSP dimension to this.

Secondly, the basic syntax using jQuery and the jQuery UI dialog plugin would be something like:


If you are using your own dialog system, you'd need to adjust accordingly.
 
Kaiser Rahman
Greenhorn
Posts: 17
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I'm new to Servlets/JSP.

You mentioned loading to servlet, so, I have to have retriving logic from database to the servlets. And then display the content using JQuery code you stated!



Bear Bibeault wrote:Firstly, I've moved this to the HTML/JavaScript forum as there really isn't any JSP dimension to this.

Secondly, the basic syntax using jQuery and the jQuery UI dialog plugin would be something like:


If you are using your own dialog system, you'd need to adjust accordingly.

 
Bear Bibeault
Sheriff
Posts: 67746
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 are new to servlets and JSP, you might want to read this article to get a good handle on what JSP is all about.

Then read this article to understand how to properly structure a modern Java web app.

So to answer your question: yes, a servlet would be used to delegate to the model to fetch anything from the DB; including HTML blobs.
 
Kaiser Rahman
Greenhorn
Posts: 17
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Thanks so much, but, would you mind providing an example of retrieving HTML blob contents for a servlet?

Best Regs.
 
Bear Bibeault
Sheriff
Posts: 67746
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
Do you know how to use JDBC? Reading an HTML fragment from a DB column would be exactly the same as reading any other text string. The fact that it's HTML is completely irrelevant.
 
It's just a flesh wound! Or a tiny ad:
a bit of art, as a gift, that will fit in a stocking
https://gardener-gift.com
reply
    Bookmark Topic Watch Topic
  • New Topic