•
•
•
•
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
![]() |
•
•
Join Date: Dec 2007
Posts: 1
Reputation:
Rep Power: 0
Solved Threads: 0
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
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
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
----------------------------------------------
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
![]() |
•
•
•
•
•
•
•
•
DaniWeb JSP Marketplace
•
•
•
•
Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
- learning php (PHP)
- JSP Sessions Help (JSP)
- some software questions I need help with (Computer Science and Software Design)
Other Threads in the JSP Forum
- Previous Thread: another session problem
- Next Thread: about applets at netbean5.0



Linear Mode