Struts: Problem rewrite page for links and images


I'm new to Struts, and I'm developing my first web application using Struts.  Actually I'm just following the guidelines of the tutorial that I have.

Currently I'm facing 2 problems:

1) Images:  According to my tutorial, you can use page rewrite when you use images in a tile.    
    So what I do is this:
    - in the head I define:
      <%@ taglib uri="" prefix="tiles" %>
      <%@ taglib uri="" prefix="html" %>
    - to put the image, I use:
      <img src="<html:rewrite page='/imgs/chimay01.bmp'/>">

    The problem is that the img doens't show.  I checked that the url and everything is correct,
    but apparently that ain't the problem.

2) Links:  When I click on them, they don't redirect.  You can hear the typical "click", but ...
    that's all.
    - I define them like this:
      <a href="html:rewrite page='/history.jsp'/>">History</a>

Now, the rewrite page works perfectly for the stylesheet when I use this:
<link rel="stylesheet" href="<html:rewrite page='/css/styles01.css'/>" type="text/css">

I read somewhere that, to use images and rewrite page, you should put the value $P in the pagePattern.  I guess that refers to the struts-config file, so what I did there was this:

Any suggestions?

Thanks in advance


Who is Participating?

[Product update] Infrastructure Analysis Tool is now available with Business Accounts.Learn More

I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.


r u using Tiles? if not, there is no need to define the processor class. Moreover, why do u need the pagePattern? Any special reason for pagePattern? There is nothing like you need to use a special pagePattern for using rewrite tag.

remove the controller element and check it.


s5020847Author Commented:

Yes, I'm using tiles.  I'm not really sure what the page pattern does actually ... I just read somewhere that you need it for images that use rewrite page ... :o(

Anyway, I took the pagePattern away, but the problem is still the same ...
s5020847Author Commented:
I found it!  The thing is that you have to put the following line in the tile itself:

 <%@ taglib uri="" prefix="html" %>

PAQed with points refunded (125)

Community Support Moderator

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today

From novice to tech pro — start learning today.