• Post Reply Bookmark Topic Watch Topic
  • New Topic

How to include image in a JSP?  RSS feed

 
Balaji Krishnan
Greenhorn
Posts: 19
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I need to include images(car) in a jsp. This jsp file is used to list down the various cars. I am using <img src=""> to perform this. But all of these images won't be in same dimensions. How can i include these images dynamically without affecting screen design.

 
Bear Bibeault
Author and ninkuma
Marshal
Posts: 65833
134
IntelliJ IDE Java jQuery Mac Mac OS X
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
You can control the size of the displayed images with CSS. Why can't you just make the images the right size in the first place?
 
Balaji Krishnan
Greenhorn
Posts: 19
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thanks for your guidance. As i can't have control over the images, i would like to go with the CSS approach. Please clarify if i can still use CSS, if the uploaded contents are HTML files not images.
 
Bear Bibeault
Author and ninkuma
Marshal
Posts: 65833
134
IntelliJ IDE Java jQuery Mac Mac OS X
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
You can't show HTML with an <img> tag, so that's not going to work in any case.

Perhaps you should tell the whole story about what you are trying to accomplish. Otherwise, time is wasted guessing.
 
Balaji Krishnan
Greenhorn
Posts: 19
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I need to show the uploaded content in a jsp. It could be either a image or html file. For html i will be using widget tag inside in the jsp, which will act as jsp:include at runtime for the html. And for image we can img src. But my concern is about the dimension of the uploaded file. How to handle these dynamic files in jsp?
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!