Pierre,
Isn't this URL rewriting? Shouldn't the tag be called rewriteURL instead of
encodeURL?
Unless I'm mistaken, URL encoding is when you encode special characters in a
URL, like turning spaces into %20, etc., and URL rewriting is when you
modify the URL to embed the session ID.
--
Martin Cooper
Tumbleweed Communications
----- Original Message -----
From: "Pierre Métras" <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>
Sent: Thursday, November 16, 2000 11:18 AM
Subject: encodeURL tag
> Hi all,
>
> Here is a very simple tag. It's role is to add session encoding to its
> parameter if the client browser doesn't support cookies.
>
> In the majority of cases, you don't need it because <link> and <forward>
do
> it already. I had the need for it when my application opens a new window
> from JavaScript to present messages to the user:
>
> <script language="JavaScript" type="text/javascript">
> window.open('<s:encodeURL href="error.do?action=1243" />');
> </script>
>
> Add the following declaration to your struts.tld file:
>
> <tag>
> <name>encodeURL</name>
> <tagclass>org.apache.struts.taglib.EncodeURLTag</tagclass>
> <bodycontent>EMPTY</bodycontent>
> <info>Encodes the URL given as parameter, adding session
information
> if necessary</info>
> <attribute>
> <name>href</name>
> <required>true</required>
> <rtexprvalue>true</rtexprvalue>
> </attribute>
> </tag>
>
> Hope this helps.
>
> Pierre Métras
>
>
>