Struts and the html:base tag question, can't see images

M

Mehmet Gunacti

hello,
i'm a newbie to struts and have a question about the base tag.
the html:base tag produces this output :
<base href="http://localhost:9080/emanet/pages/layouts/mainLayout.jsp">
now, the whole jsp path is visible to everyone, although the request
uri is "http://localhost:9080/emanet/". is this ok, that everybody can
see the project folder structure ? how can this be avoided ?

the folder structure looks like this :

webContent
----images
----pages
--------layouts
--------tiles

when displaying a layout (jsp) under /pages/layouts, the images, which
are refered as <img src="/images/myImage.jpg"> don't show.
after changing to <img src="/emanet/images/myImage.jpg"> the image
gets showed in browser. thus i have to include the context root of the
web application. what if some day in future the context root has to be
modified ?
how do the struts developers solve this problem ?
every answer is appreciated.
thanks in advance
 
A

analogueboy

the base tag is included so that the client can request the correct graphics
etc so it shouldn't cause a problem. It is usually better to make all
requests pass through the central controller, that way people won't ever see
the location of the jsps and your are free to refactor the layout without
breaking the page flow.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,767
Messages
2,569,570
Members
45,045
Latest member
DRCM

Latest Threads

Top