[jboss-user] [JBoss Portal] - Re: Images and portlets

PeterJ do-not-reply at jboss.com
Thu Nov 23 22:33:59 EST 2006

Assume you have an image file located at image/some.gif. To access this from a JSP within your portlet, do this:

<%@ taglib uri="http://java.sun.com/portlet" prefix="portlet" %>
  | <portlet:defineObjects/>
  | <img src="<%= renderRequest.getContextPath() %>/image/some.gif" />

The context path obtained from the render request provides the proper context. 

Of course, you can create a similar < img > tag from within the portlet itself (I prefer letting the JSP build the user interface).

View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=3988325#3988325

Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=3988325

More information about the jboss-user mailing list