Why not simply use the onclick handler attribute ?

-----Original Message-----
From: Craig R. McClanahan [mailto:[EMAIL PROTECTED]]
Sent: Thursday, July 25, 2002 9:00 PM
To: Struts Users Mailing List
Subject: Re: jsession id get appended to the javascript function




On Thu, 25 Jul 2002, Tarun Sainanee wrote:

> Date: Thu, 25 Jul 2002 17:30:25 +0530
> From: Tarun Sainanee <[EMAIL PROTECTED]>
> Reply-To: Struts Users Mailing List <[EMAIL PROTECTED]>
> To: [EMAIL PROTECTED]
> Subject: jsession id get appended to the javascript function
>
> Hi,
>
> I am using weblogic6.1 sp2 and have also implememted struts framework.
> About the problem that i am facing, here goes:
>
> I have the following two links in my jsp file
> Link 1: Is implemented using the struts tlds
> <html:link href="javascript:check_click()"><html:img
> src="/ModBoa/images/clear.gif" border="0"/></html:link>
>
> Link 2: Is implemented using conventional html
> <a href="javascript:check_click()"><img src="/ModBoa/images/clear.gif"
> border="0"></a>
>
>
> These two links call the same javascript function ie. they point to the
> same functionality.
>
> Now when i click on link 2, the javascript function is called as expected
> and the function is carried out.
> However, if i had clicked on link 1 instead of clicking on link 2, i get a
> javascript error.
>
> The error occurs because a jessionid is appended to the name of the
> javascript function.
> So in effect, when i take my mouse over link 2, the browser status bar
> shows just the name of the javascript function.
> But when i place my mouse over link 1, the browser status bar shows the
> jsession id appended to the name of the javascript function
>
> And this is a problem that occurs that only whenever a new session is
> created (one of the many ways to create a new session is by opening a new
> browser instance).
>
> Anyone has any clue to what i am talking about?
>

The <html:link> tag automatically calls response.encodeURL on the URLs it
generates, on the assumption that it is a link into the same web
application, and therefore needs a session id added (if cookies are
disabled, or if this is the first response in a new session).

One would think that WebLogic would recognize from the "javascript:"
scheme that this is not an http-style link and not perform the rewriting,
but apparently it doesn't.  You're probably better off using the Link 2
format for a link like this.

> Thnx in advance.
>
> Tarun Sainanee
>

Craig



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

This e-mail and any files transmitted with it are for the sole use of the intended 
recipient(s) and may contain confidential and privileged information.
If you are not the intended recipient, please contact the sender by reply e-mail and 
destroy all copies of the original message. 
Any unauthorised review, use, disclosure, dissemination, forwarding, printing or 
copying of this email or any action taken in reliance on this e-mail is strictly 
prohibited and may be unlawful.

                Visit us at http://www.cognizant.com


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

Reply via email to