Fórumok

[Solved][Question] how loading images in config,jsp?

Paolo Pilitti, módosítva 10 év-val korábban

[Solved][Question] how loading images in config,jsp?

Junior Member Bejegyzések: 51 Csatlakozás dátuma: 2011.04.13. Legújabb bejegyzések
hi all

i'm trying to load and show an image file in the config.jsp page of my portlet.
The image is located in MyPortlet-portlet\docroot\img

In the view.jsp page i can load successfully the image with the line
<img src="<%= request.getContextPath()%>/img/view/my_image.png"/>

but in config it doesnt work.

In config he request.getContextPath() is empty


So, what is the correct way to load the image in config.jsp?

I dont want to put the image in template.

regards

Paolo Politti
thumbnail
vipin bardia, módosítva 10 év-val korábban

RE: [Question] how loading images in config,jsp?

Regular Member Bejegyzések: 162 Csatlakozás dátuma: 2011.02.28. Legújabb bejegyzések
Hi Paolo,

When we use configuration mode, it's a different portlet "Portlet Configuration - 86" . For the same reason your are not able to find request.getContextPath().

If you want to load your images you ca pass static path -

<img src="/MyPortlet-portlet/img/view/my_image.png"/>
Paolo Pilitti, módosítva 10 év-val korábban

RE: [Question] how loading images in config,jsp?

Junior Member Bejegyzések: 51 Csatlakozás dátuma: 2011.04.13. Legújabb bejegyzések
it works !
thanks