Win a copy of Cross-Platform Desktop Applications: Using Node, Electron, and NW.js this week in the JavaScript forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic

setting the request attributes from Javascript  RSS feed

 
karthik meda
Greenhorn
Posts: 6
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi,

I am trying to code a JSP page where in i want to store the parameters of the Javascript function into the session object.
My code looks something like this :

function getAttributes( chId, role )
{
with (self.document.ChannelMgmtForm)
{
action="<%= request.getContextPath()%>/ChannelViewAttributes.do";
channelId.value = getChannelId( chId );
roleCd.value = role;
target="";
submit();
}
}

Now what i need to do is something like this :
<%session.setAttribute("baseChannelId",chId); %>.
Where "chId" is the Javascript function parameter.
So everytime the Javascript function is called i need to put the value into the session object.
Is this possible in some way ?

thanks for the help.
karthik
 
karthik meda
Greenhorn
Posts: 6
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi,

Sorry i typed the subject of the thread wrong, i mean "session" instead of the "request" object
 
Eric Pascarello
author
Rancher
Posts: 15385
6
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
javascript can not set things that happen on the server,

client side is sepearted from server side

You need to post a form back in order to get the client side value.

Eric
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!