User Name Password Register
DaniWeb IT Discussion Community
All
What is DaniWeb IT Discussion Community?
You're currently browsing the JSP section within the Web Development category of DaniWeb, a massive community of 423,864 software developers, web developers, Internet marketers, and tech gurus who are all enthusiastic about making contacts, networking, and learning from each other. In fact, there are 3,902 IT professionals currently interacting right now! Registration is free, only takes a minute and lets you enjoy all of the interactive features of the site.
Please support our JSP advertiser: Lunarpages JSP Web Hosting
Views: 1037 | Replies: 1
Reply
Join Date: Dec 2007
Posts: 1
Reputation: virividivici is an unknown quantity at this point 
Rep Power: 0
Solved Threads: 0
virividivici virividivici is offline Offline
Newbie Poster

JSP sessions in javascript

  #1  
Dec 13th, 2007
Hello everyone,
I need to change the value of a jsp variable in javascript.
I have got this code in my .jsp page:

<c:set var="searchType" value="jobsearch" />

the value of the "searchType" should change depending on which link the user click on.
I though if I put this variable in a session its better. what I mean is I will swap this code with:

<jsp:scriptlet>
WebUtils.setSessionAttribute(request, "searchType", "jobsearch");
</jsp:scriptlet>

now, I dont know how to change the value of this session in javascript. can anyone answer me please?

Thanks
Zoe
AddThis Social Bookmark Button
Reply With Quote  
Join Date: Feb 2006
Posts: 1,456
Reputation: masijade is just really nice masijade is just really nice masijade is just really nice masijade is just really nice masijade is just really nice 
Rep Power: 9
Solved Threads: 129
masijade's Avatar
masijade masijade is online now Online
Nearly a Posting Virtuoso

Re: JSP sessions in javascript

  #2  
Dec 13th, 2007
You can't. The JSP runs on the server, JavaScript on the client. The only thing you can do is set a parameter and submit a form (or something to that effect).
Java Programmer and Sun Systems Administrator

----------------------------------------------

Debugging is twice as hard as writing the code in the first place. Therefore, if you write the code as cleverly as possible, you are, by definition, not smart enough to debug it.
--Brian Kernighan
Reply With Quote  
Reply

Only community members can participate in forum threads. You must register or log in to contribute.

DaniWeb JSP Marketplace
Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)

 

Thread Tools Display Modes

Similar Threads
Other Threads in the JSP Forum

All times are GMT -4. The time now is 4:09 am.
Forum system based on vBulletin Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
©2003 - 2008 DaniWeb® LLC