Win a copy of Design for the Mind this week in the Design forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

showing dynamic image in web application

 
Suddhasattwa Mukherjee
Ranch Hand
Posts: 52
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi All,
I am using jboss 4.0.4 GA and trying to create an enterprise application with struts frame work.Here I want to have a dynamic image.Like on the given data I generate a chart with jfreechart and saved it as png image.Now I want to view this image.Any idea about this.How to do it?I have tried some options,like
1. reading the image file as Stringbuffer and putting it in the session after that writing in the jsp page.
2.using image tag in jsp file with source taken from properties file.
First did not work at all.Second one works in my system only i.e. on eher jboss is located not on other system.

Please help me out.
 
Jaikiran Pai
Marshal
Pie
Posts: 10447
227
IntelliJ IDE Ubuntu
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Suddhasattwa,

This does not look like a JBoss specific question. I'll move this question to an appropriate forum where you might get help

Right now, it looks like the JSP or the Servlet forum are suited for your question since this is related to rendering image in a web application.
 
Suddhasattwa Mukherjee
Ranch Hand
Posts: 52
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thanks for your effort.But I thought that it might also be the JBoss issue.Like where to place the file in jboss and how to configure different parameter, it depends on the application environment.
 
raj malhotra
Ranch Hand
Posts: 288
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
First did not work at all.Second one works in my system only i.e. on eher jboss is located not on other system.


you should post the code snippet.Just check if Ben's advice solve your problem.
 
Suddhasattwa Mukherjee
Ranch Hand
Posts: 52
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thank you raj for your advice.this really works for me.

I put the value getServletContext().getRealPath("/") in the session.it gives me the absolute path of the application.I put the dynamically generated image file there and access the file when required as request.getContextpath() in jsp page.
 
It is sorta covered in the JavaRanch Style Guide.
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic