read my mail... on the serverside you can use WebContextFactory.get().getSession()

David Harland wrote:
Im using DWR. The problem is that the java class that the javascript
talks to does not have access to the session. What would be better would
be for the dwr javascript to talk to an action.
-----Original Message-----
From: Lance [mailto:[EMAIL PROTECTED] Sent: 13 April 2007 16:35
To: Struts Users Mailing List
Subject: Re: ajax and struts 2

ew... that sounds icky!
have you considered DWR, it marshalls calls from javascript to java then
marshalls the result back into javascript objects for you.

http://getahead.org/dwr/overview/dwr
on the serverside you can use WebContextFactory.get().getSession()

Mahesh Parab wrote:
Hi David,
u can able to read the session variable in javascript, e.g var intId intId='<%=session.getValue("id")%>' ;

try this ,

Thanks,
mahesh.

On 4/12/07, David Harland <[EMAIL PROTECTED]> wrote:
I am new to ajax and have just written my first ajax function. In my function I am passing a user id into the function and are being returned a List of Contacts to populate a select. Presently I am putting the id in a hidden field in the jsp and then passing it from there. What I would prefer to do is have the javascript function call

an action so that the Java code can access the user id from the session.

How do I do this please?




     Don't be flakey.  Get Yahoo! Mail for Mobile and always stay
connected to friends.    http://mobile.yahoo.com/mail

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




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


- ------
ML {UFI}

______________________________________________________________________
Ufi Limited Registered in England No. 3980770 Registered Office: Dearing House, 1 Young Street, Sheffield, S1 4UP learndirect Solutions Ltd Registered in England No. 5081669 Registered Office: Dearing House, 1 Young Street, Sheffield, S1 4UP UFI Charitable Trust Registered in England No. 3658378 Registered Charity No. 1081028 Registered Office: Dearing House, 1 Young Street, Sheffield, S1 4UP
This email has been scanned by the MessageLabs Email Security System.

______________________________________________________________________

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



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

Reply via email to