struts-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Elankath, Tarun (Cognizant)" <>
Subject RE: jsession id get appended to the javascript function
Date Thu, 25 Jul 2002 16:45:43 GMT
Why not simply use the onclick handler attribute ?

-----Original Message-----
From: Craig R. McClanahan []
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 <>
> Reply-To: Struts Users Mailing List <>
> To:
> 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


To unsubscribe, e-mail:
For additional commands, e-mail:

View raw message