This week's book giveaway is in the Jython/Python forum.
We're giving away four copies of Hands On Software Engineering with Python and have Brian Allbey on-line!
See this thread for details.
Win a copy of Hands On Software Engineering with Python this week in the Jython/Python forum!
  • 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 all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Bear Bibeault
  • Knute Snortum
  • Liutauras Vilda
Sheriffs:
  • Tim Cooke
  • Devaka Cooray
  • Paul Clapham
Saloon Keepers:
  • Tim Moores
  • Frits Walraven
  • Ron McLeod
  • Ganesh Patekar
  • salvin francis
Bartenders:
  • Tim Holloway
  • Carey Brown
  • Stephan van Hulst

How can I paint a chart in the jsp  RSS feed

 
Greenhorn
Posts: 11
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I want to paint a chart in the .jsp file using the data got from DataBase.
How can I do that?
 
Ning Du
Greenhorn
Posts: 11
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
When I make a binary file using servlet,the content of HTML cannot be displayed.What should I do? Applet?
[ August 16, 2003: Message edited by: Adu Ning ]
 
Author and all-around good cowpoke
Posts: 13078
6
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Think about how a HTML page containing an image is built. Each chart or other image must be the result of a separate IMG tag that you write in your JSP. The SRC= attribute in the IMG tag should point to a servlet that can generate the binary image data.
You can't use a JSP to generate typical image files because a JSP is designed to output text, not binary image data. There have been a number of discussions of this here. Any book on servlets will tell you how this is done.
Bill
 
Ning Du
Greenhorn
Posts: 11
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
William,thank you for your reply.Someone told me img=attribute tag poits to a .dll file can also solve the question.right?
 
Ranch Hand
Posts: 1056
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I don't understand what you mean by that.
 
Greenhorn
Posts: 4
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I have my <img ...> tag point to a servlet which gets a chart using JFree chart (jfree.org), then uses a class included in the Jfree stuff that will display the image with the OutputStream. Display line is something like:
ChartUtilities.writeChartAsJPEG(out,chart,820,380);
 
William Brogden
Author and all-around good cowpoke
Posts: 13078
6
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator

William,thank you for your reply.Someone told me img=attribute tag poits to a .dll file can also solve the question.right?


The IMG tag in HTML requires a SRC="URL" - the url is used to load the image data. That could be the URL of a servlet plus parameters that might include the name of a dll that is somehow involved. What image source do you want to use?
Bill
 
Ron Newman
Ranch Hand
Posts: 1056
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
What is a "dll" ?
 
Ning Du
Greenhorn
Posts: 11
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Something like :<IMG height="268" border="0" width="323" SRC="http://202.108.253.131:8080/wwwhq.dll?srv=401&...">
 
Marshal
Posts: 67192
169
IntelliJ IDE Java jQuery Mac Mac OS X
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I believe that a DLL can be used if it implements the ISAPI interface. This of course ties one into the Microsoft platform. Not a great idea, imho.
bear
 
Stinging nettles are edible. But I really want to see you try to eat this tiny ad:
RavenDB is an Open Source NoSQL Database that’s fully transactional (ACID) across your database
https://coderanch.com/t/704633/RavenDB-Open-Source-NoSQL-Database
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!