struts-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Brice Ruth <br...@fiskars.com>
Subject Re: how to disable (or work around) jsessionid in html:img sources
Date Thu, 13 Nov 2003 22:28:19 GMT
Btw, Kris - I just had to make use of this code that you provided, and 
it works perfectly. Sweet!

Kris Schneider wrote:

>If you can accomplish what you want via Apache rewrite rules, that seems like a
>simpler solution. If that doesn't work out, here's a JSP/JSTL equivalent of how
><html:img> comes up with the module path:
>
><%@ page import="org.apache.struts.Globals" %>
><%@ taglib prefix="c"    uri="http://java.sun.com/jstl/core" %>
><%@ taglib prefix="c_rt" uri="http://java.sun.com/jstl/core_rt" %>
>
><c_rt:set var="moduleKey" value="<%= Globals.MODULE_KEY %>"/>
><c:set var="moduleConfig" value="${requestScope[moduleKey]}"/>
><c:set var="prefix" value=""/>
><c:if test="${not empty moduleConfig}">
>    <c:set var="prefix" value="${moduleConfig.prefix}"/>
></c:if>
><c:set var="modulePath"
>       value="${pageContext.request.contextPath}${prefix}"/>
>
><img src="<c:out value="${modulePath}/path/to/image"/>">
>
>Quoting dutrieux <dutrieux@pasteur.fr>:
>
>  
>
>>Maybe you can try, But I think the impacts is all pages send to apache 
>>then all virtualhosts defiend by the mod_jk.
>>
>>Ruth, Brice a écrit :
>>
>>    
>>
>>>Is this something I can do at a global level, so that it impacts all 
>>>virtualhosts defined by the mod_jk auto configuration file generated 
>>>by Tomcat's connector?
>>>
>>>dutrieux wrote:
>>>
>>>      
>>>
>>>>Hello
>>>>
>>>>For Apache v3.x you need to put in "httpd.conf" file this entry :
>>>>
>>>>RewriteRule ^(.*);jsessionid=.*$ $1 [L]
>>>>
>>>>Best regards
>>>>
>>>>Olivier Dutrieux
>>>>*
>>>>
>>>>*
>>>>Ruth, Brice a écrit :
>>>>
>>>>        
>>>>
>>>>>Ruth, Brice wrote:
>>>>>
>>>>>          
>>>>>
>>>>>>Hi. I'm using html:img in certain tiles that are used from very 
>>>>>>different places in my application with the "page" attribute to 
>>>>>>take advantage of module-relative naming for the image sources. 
>>>>>>However, when cookies aren't enabled, or on the first visit to the

>>>>>>web application (with no session cookie having been previously 
>>>>>>detected), the ';jsessionid=X' gets added to the end of the image.

>>>>>>Now, I'm not driving any dynamic images, nor do I intend to, so 
>>>>>>this sessionid is worthless to me. Furthermore - since I'm using 
>>>>>>Apache+Tomcat+mod_jk to serve this application, Apache seems to 
>>>>>>choke on serving up this image. I expect its because the sessionid

>>>>>>is delimited by ';' instead of '?' as I'm used to, but maybe not.
>>>>>>
>>>>>>Either way - does anyone know of a way to get around this? If 
>>>>>>possible, I'd prefer not having to do anything special in the 
>>>>>>Apache conf, mainly because I'm using the auto-generated mod_jk 
>>>>>>conf file for this configuration.
>>>>>>
>>>>>>Thanks!
>>>>>>
>>>>>>            
>>>>>>
>>>>>Any takers on this? This is kinda hosin' up my Apache/Tomcat setup 
>>>>>... Tomcat standalone serves up the images fine with the jsessionid 
>>>>>junk, but Apache doesn't!
>>>>>
>>>>>          
>>>>>
>>>>---------------------------------------------------------------------
>>>>To unsubscribe, e-mail: struts-user-unsubscribe@jakarta.apache.org
>>>>For additional commands, e-mail: struts-user-help@jakarta.apache.org
>>>>
>>>>        
>>>>
>>-- 
>>
>>------------------------------------------------------------------------
>>*Olivier Dutrieux*
>>------------------------------------------------------------------------
>><www.pasteur.fr>
>>------------------------------------------------------------------------
>>
>>Institut Pasteur
>>Informatique de gestion
>>&
>>Micro-Informatique
>>
>>25-28 rue du Docteur Roux
>>75724 PARIS CEDEX 15
>>
>>------------------------------------------------------------------------
>>Tel: +33 (0) 1 40 61 31 62
>>Fax: +33 (0) 1 45 68 89 89
>>
>>------------------------------------------------------------------------
>>    
>>
>
>  
>

-- 
Brice D. Ruth
Sr. IT Analyst
Fiskars Brands, Inc.



---------------------------------------------------------------------
To unsubscribe, e-mail: struts-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: struts-user-help@jakarta.apache.org


Mime
View raw message