[stringtemplate-interest] url rewriting and session management
Harry
harry.karadimas at hmn.aphp.fr
Mon Sep 10 02:22:07 PDT 2007
Hi,
I have a question about URL rewriting and session management in st.
When a user turns off cookie management (some of our users do that), the
servlet containers
switch to "url rewrite" mode to maintain session across web page submissions.
(see for more information the method encodeURL here :
http://java.sun.com/products/servlet/2.3/javadoc/javax/servlet/http/HttpServlet
Response.html#encodeURL(java.lang.String))
The official servlet doc says that
"For robust session tracking, all URLs emitted by a servlet should be run
through this method"
which as far as I can see is not always the case in st if we insert a simple
attribute with a link.
My method is a bit cumbersome, but it works :
* I have a renderer for java.lang.String, that escapes HTML special chars ('<',
'>', '&')
* Links are of a special type (e.g. "HtmlLink")
* I register a specialized renderer with the stringtemplate instance, this
renderer uses the response object to call "encodeURL" to render correctly
objects of type "HtmlLink"
* As this renderer must be attributed "on the fly", I have to duplicate the
stringtemplate instance first
Did you have the same concerns ? Is there a more elegant way to do it ?
Best regards,
Harry Karadimas
______________________________________________________________________
Dr Harry Karadimas Medecin Ingenieur
resp. Recherche et Developpement, Administration Wintel
Departement d'Information Hospitalier (DIH)
C.H.U. Albert Chenevier - Henri Mondor
51, av. du Marechal de Lattre de Tassigny 94010 CRETEIL
tel : (00 33 1) 49 81 21 79 fax : (00 33 1) 49 81 27 08
secr.: (00 33 1) 49 81 23 82 m.el.:harry.karadimas at hmn.aphp.fr
More information about the stringtemplate-interest
mailing list