Jump to content


Check out our Community Blogs

Register and join over 40,000 other developers!


Recent Status Updates

View All Updates

Photo
- - - - -

Set request session attribute from JavaScript

session

  • Please log in to reply
No replies to this topic

#1 papamonos

papamonos

    CC Lurker

  • Just Joined
  • Pip
  • 1 posts

Posted 06 June 2009 - 04:05 AM

Hi everybody!

I'm programming a Web Application that use a JSP file. JSP have a JavaScript function that receives a param value, and I wanna set this value to a HttpServletRequest session attribute, as this:
function receiveParam(value)
{
   <%
     request.getSession().setAttribute("param", value);
  %>
}

Problem with this way is that code don't recognize "value" param cause integrates java code. I tried using this line:

request.getSession().setAttribute("param", %>value<%);

But this give a sintaxis error. How I can make this? Exist some method from javascript (as window.alert) that get request session?

I don't dominate this, as you see :blushing:

Thanks!

Edited by Jordan, 06 June 2009 - 05:43 AM.
Use code tags, please

  • 0





Also tagged with one or more of these keywords: session

Recommended from our users: Dynamic Network Monitoring from WhatsUp Gold from IPSwitch. Free Download