| Author |
How to include image in a JSP?
|
Balaji Krishnan
Greenhorn
Joined: Dec 14, 2011
Posts: 13
|
|
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
Joined: Jan 10, 2002
Posts: 56204
|
|
|
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?
|
[Smart Questions] [JSP FAQ] [Books by Bear] [Bear's FrontMan] [About Bear]
|
 |
Balaji Krishnan
Greenhorn
Joined: Dec 14, 2011
Posts: 13
|
|
|
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
Joined: Jan 10, 2002
Posts: 56204
|
|
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
Joined: Dec 14, 2011
Posts: 13
|
|
|
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?
|
 |
 |
|
|
subject: How to include image in a JSP?
|
|
|