aspose file tools*
The moose likes JSP and the fly likes How session Info is sent to JavaScript (Client) here? Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Spring in Action this week in the Spring forum!
JavaRanch » Java Forums » Java » JSP
Bookmark "How session Info is sent to JavaScript (Client) here?" Watch "How session Info is sent to JavaScript (Client) here?" New topic
Author

How session Info is sent to JavaScript (Client) here?

Mishra Anshu
Ranch Hand

Joined: Sep 16, 2003
Posts: 224
Hello!!
I have written a page which consists of two Frames(HTML).
I want to arrange the info. in left frame as shown below:-
-Company1
+ About Us
+ Help
-Users
+ prefix
+ Services
+ User Info
+Company2
+Company3
So, whenever a "+" is clicked in the left frame it changes into "-" and the subtree is produced below it. I have done this as far as th things are static (like "About Us", "Help") using JavaScript.
But, Now I want to get the Users list. So, It is expected to get the data from server and then to reflect this change(i.e....the list of users as sent
by the server) in this frame just below the Users.

Also, if possible tell me if how could it be acgeived if somebody wants that
in every new login all the expanded tree be shown at is was during the previous session.
Thanks for ur's suggestion


"Ignorance is bliss"
Debashish Chakrabarty
Ranch Hand

Joined: May 14, 2002
Posts: 230

Originally posted by Mishra Anshu:

But, Now I want to get the Users list. So, It is expected to get the data from server and then to reflect this change(i.e....the list of users as sent
by the server) in this frame just below the Users.

Well I can suggest generating this complete Javascript dynamically using a JSP or a bean that returns this "script" as string. The User information is indeed a server side job, and this information must be readily available to the client-side script. So when a user clicks on "+" he sees the expanded user list as if the data was fetched then and there. Actually the information would already be there on the client side script, fetched by your JSP/Servlet and made available inside script variables.
Tell me if it helped


Debashish
SCJP2, SCWCD 1.4, PMP, ITIL Foundation
Eric Pascarello
author
Rancher

Joined: Nov 08, 2001
Posts: 15376
    
    6
If you want the tree to be the way they left, you are going to need to use a cookie to remember the state that it was when the user left or store information in a database.
Eric
Mishra Anshu
Ranch Hand

Joined: Sep 16, 2003
Posts: 224
Thanks to both of You!!!
So, Should I use the session variable inside my client side javascript to
remember it the state where it left.
Can u plz. provide any such link.
Thanks again!!
 
jQuery in Action, 2nd edition
 
subject: How session Info is sent to JavaScript (Client) here?