• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Setting Header and Getting in next page

 
Charmy Madhvani
Ranch Hand
Posts: 59
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi All,
I tried to set Header in one page and get it in another.
<html>
<head>
<title>Setting Headers</title>
</head>
<script language="JavaScript">
function fnOnClickSubmit()
{
alert('Hi')
document.form1.action = "gettingHeaders.jsp";
document.form1.submit();
}
</script>
<body >
<form name="form1" method="post" action = "gettingHeaders.jsp">
<p>Hi , My Name is Charmy</p>
<%
response.setHeader("USERNAME","ADMIN");
response.setHeader("PASSWORD","ADMIN");

%>
<input type="Submit" value="Submit" onSubmit="javascript:fnOnClickSubmit();">
</form>
</body>
</html>

and tried to do request.getHeader("USERNAME") in gettingHeaders.jsp.
But I am getting null. Can anybody please tell me how do I set header in such a way that I get it as request.getHeader("USERNAME") in next page.
Kindly respond..
Thanks in advance
 
Marc Peabody
pie sneak
Sheriff
Posts: 4727
Mac Ruby VI Editor
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Previous discussion of this topic

Cheers!
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic