This week's book giveaway is in the Performance forum.
We're giving away four copies of The Java Performance Companion and have Charlie Hunt, Monica Beckwith, Poonam Parhar, & Bengt Rutisson on-line!
See this thread for details.
Win a copy of The Java Performance Companion this week in the Performance forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

How to display images in a portlet

 
Alejandro Barrero
Ranch Hand
Posts: 335
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I am displaying HTML text in a prtlet and the text contains images and the text contains references to images like "". Everything works in a web application if I create rhe images directory in Web Pages. But that doesn´t work in aportlet.

Your help will be greatly apprciated,

Alejandro Barrero
 
Cameron Wallace McKenzie
author and cow tipper
Saloon Keeper
Posts: 4968
1
Hibernate Spring Tomcat Server
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Gosh darnit! Here's a tutorial I put together called "Displaying Images in a Portlet." Enjoy!

Portlet Development Tutorial: Displaying Images

-Cameron McKenzie
 
Alejandro Barrero
Ranch Hand
Posts: 335
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thank you very much; it looks you are answering my two questions. It appears the solution in both case is to map the paths with renderResponse.ecodeURL and renderRequest.getContextPath. I am trying that, but unfortunately in thisw code:

I am getting the error "cannot find symbol" for each of renderResponse, encodeURL, renderRequest and getContextPath.
I don{t know what I am missing.
 
Alejandro Barrero
Ranch Hand
Posts: 335
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
For some reason <portlet:defineObjects /> is not working. I can get renderResponse and renderRequest from the request, but I don{t know what keys to use.
 
Alejandro Barrero
Ranch Hand
Posts: 335
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I am using <%@ taglib uri="http://java.sun.com/portlet" prefix="portlet"%> but still doesn´t work.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic