| Author |
<img> tag
|
Ganesh Podaralla
Greenhorn
Joined: Feb 22, 2010
Posts: 23
|
|
Hi,
I am trying to import an image under my application context.
I know that there are two ways to place the file location under src.
Absolute Path: <img src="http://www.someweb.com/webapp/logo.jpg" >
Relative Path: <img src=logo.jpg"> which displays the image based on the location of the jsp.
<img src="/webapp/logo.jpg"> which displays the image from the application context relative path. In this case, we need to mention the application context path (webapp). How can I display the image relative to the context path but without mentioning the context (webapp)? Is there anyway I can avoid mentioning "webapp" in <img src="/webapp/logo.jpg"> ??
Thanks,
Ganesh
|
 |
Bear Bibeault
Author and ninkuma
Marshal
Joined: Jan 10, 2002
Posts: 56191
|
|
|
This is covered in the JSP FAQ. You can obtain the context path programmatically and should never hard-code it.
|
[Smart Questions] [JSP FAQ] [Books by Bear] [Bear's FrontMan] [About Bear]
|
 |
Ganesh Podaralla
Greenhorn
Joined: Feb 22, 2010
Posts: 23
|
|
|
Thanks Bear Bibeault...That really helps..
|
 |
Bear Bibeault
Author and ninkuma
Marshal
Joined: Jan 10, 2002
Posts: 56191
|
|
|
 |
 |
|
|
subject: <img> tag
|
|
|