Win a copy of Learn Spring Security (video course) this week in the Spring forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

response.setHeader problem

 
raj guntupalli
Greenhorn
Posts: 27
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi,
I am using the following code in one jsp which calls another but I am getting null.I am using tomcat 4.1.Thanx in advance.
<html>
<%! String name="075000051"; %>
<%! String disply="test11"; %>
<%
response.setHeader("hello","hello1");
%>
<form action="http://localhost:20000/examples/jsp/jsptoserv/jsptoservlet.jsp" method="post">
<input type="hidden" name="institution_name" value="<%=name%>">
<input type="hidden" name="user_display_number" value="<%=disply%>">
<input type="submit" name="submit">
</form>
</html>
jsptoservlet.jsp
<html>
<body bgcolor="white">
<%=request.getHeader("hello")%>
</html>
 
Anonymous
Ranch Hand
Posts: 18944
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Originally posted by raj guntupalli:
Hi,
I am using the following code in one jsp which calls another but I am getting null.I am using tomcat 4.1.Thanx in advance.
<html>
<%! String name="075000051"; %>
<%! String disply="test11"; %>
<%
response.setHeader("hello","hello1");
%>
<form action="http://localhost:20000/examples/jsp/jsptoserv/jsptoservlet.jsp" method="post">
<input type="hidden" name="institution_name" value="<%=name%>">
<input type="hidden" name="user_display_number" value="<%=disply%>">
<input type="submit" name="submit">
</form>
</html>
jsptoservlet.jsp
<html>
<body bgcolor="white">
<%=request.getHeader("hello")%>
</html>


what are you trying to achieve with your response.setHeader() ??
There you only can set HTTP protocol headers, which are describen
on the W3C page. when you want to show
a different page then try a
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic