File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
The moose likes Servlets and the fly likes Showing richtext data on to Browser. Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » Servlets
Bookmark "Showing richtext data on to Browser." Watch "Showing richtext data on to Browser." New topic

Showing richtext data on to Browser.

Ranch Hand

Joined: Nov 22, 2008
Posts: 18944
I have a database field in SQL server database defined as text datatype, the data stored in that field can be either text, Images, Signatures. Is there any way in JSP to show the data on the browser, (the data stored in the database)i.e. the Images or Signatures as Images or Signatures.
Please suggest me.
William Brogden
Author and all-around good cowpoke

Joined: Mar 22, 2000
Posts: 13036
Remember that a browser has to make a separate request for an image, you can't mix the image data in with the HTML.
Your JSP page will have to find out what kind of data is in the record and format output accordingly. You will have to use a servlet to serve image data because you have to set the content type and content length. Sounds like a job for a bean shared between the JSP and a servlet.

author of:
Frank Carver

Joined: Jan 07, 1999
Posts: 6920
The Java Ranch has thousands of visitors every week, many with surprisingly similar names. To avoid confusion we have a naming convention, described at .
We require names to have at least two words, separated by a space, and strongly recommend that you use your full real name. Please log in again with a new name which meets the requirements.

Read about me at ~ Raspberry Alpha Omega ~ Frank's Punchbarrel Blog
I agree. Here's the link:
subject: Showing richtext data on to Browser.
It's not a secret anymore!