-
1. Re: Problem with picture in portlet
prabhat.jha May 30, 2008 11:45 AM (in response to khadijbal)Even your little English could help in getting more responses. How about you post both in French and English?
-
2. Re: Problem with picture in portlet
khadijbal May 30, 2008 12:12 PM (in response to khadijbal)So My question is:
i don't know why ths pictures in the jsp who use the portlet, don't appear when i deploy the portlet in the portal jboss. -
3. Re: Problem with picture in portlet
peterj May 30, 2008 1:35 PM (in response to khadijbal)If your portlet is packaged in a WAR file named xxx.war, and the picture is located at images/some.jpg, then the following code within a JSP will display the image:
<img src="/xxx/images/some.jpg" />
If that does not help you, could you post the code within the JSP that references the picture? (Bracket the code with [ code ]..[/ code ] tags, to do so, select the code an click the Code button) Also, post the contents of your WAR file (jar -ft xxx.war). -
4. Re: Problem with picture in portlet
khadijbal May 30, 2008 2:07 PM (in response to khadijbal)I have the same problem.
when i clic in the properties of the picture in the portal, the URL that portal use is:
http://localhost:8082/PortalProject/WEB-INF/images/plan.JPG
for my code in the jsp is:<img src="/PortalProject/WEB-INF/images/mypicture.JPG"/>
my picture is in the same src. -
5. Re: Problem with picture in portlet
khadijbal May 30, 2008 2:15 PM (in response to khadijbal)I don't know if this is the perfect solution, but i have first import my picture in jboss Portal and i can now view my picture, with the code:
<img src="/portal/content/default/images/Mypicture.JPG"/>
Thunks -
6. Re: Problem with picture in portlet
peterj May 30, 2008 2:54 PM (in response to khadijbal)Do not place your images in WEB-INF - the browser does not have visibility to that directory or its contents.
-
7. Re: Problem with picture in portlet
je.a.le Jun 2, 2008 4:21 AM (in response to khadijbal)as said only the server "see" WEB-INF.
Put your images into the to directory (best a sub dir). If you use netbeans, this is the "Web pages" node.
project : ac.war
images inside gfx subdir
in netbeans --> ac.war/"web Pages"/gfx/myimage.png
in the war --> ac.war/gfx/myimage.png
in your jsp :<%@taglib uri="http://java.sun.com/portlet" prefix="portlet"%> <portlet:defineObjects /> <img href="${renderRequest.contextPath}/gfx/myimage.png" />