To my knowledge the html:base tag is to help resolve images and other media. If you use the app context to resolve your images and things then there should be no issue.

<c:set var="contextPath" value="${pageContext.request.contextPath}" />
<img src="${contextPath}/images/myimage.gif" />

or

<img src="<%= request.getContextPath() %>" />

The other alternative is to use encoded urls but then you need a filter or other mechanism to remove the sessionid as this can play havoc with some browsers..

<html:img page="/images/myimage.gif" />

or

<c:url var="myimage" value="/images/myimage.gif" />
<img src="${myimage}" />

HTH Mark

On 23 Sep 2004, at 12:13, Java News wrote:

Hi,
I don't understand one simple thing with <html:base /> - when I had
read about Struts and JSTL help for them, I saw that it helps to hide
implementation, so why I got such output:
<base href="http://localhost:8180/struts_test/pages/Welcome.jsp";>
form page which was called from browser as:
http://localhost:8180/struts_test/Welcome.do

I have mapped Welcome.do as:
<action parameter="/pages/Welcome.jsp" path="/Welcome"
type="org.apache.struts.actions.ForwardAction" unknown="false"
validate="true"/>

base href tag should look like:
<base href="http://localhost:8180/struts_test/";>
am I right?

I don't want anybody to know what page an action take, I even don't
want to show that pages are written in JSP. So why Struts takes
included template, and not just stay with
http://localhost:8180/struts_test/Welcome.do or better with
http://localhost:8180/struts_test/ ?

Best Regards,
Lee

---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]


---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Reply via email to