• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

one more doubt

 
namaskaram sir
Greenhorn
Posts: 5
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
how can we print will print the value of the Accept-Charset HTTP header in a JSP page?
 
Amer Khan
Ranch Hand
Posts: 163
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
<%= request.getHeader("headerName") %>
or
<% String header =request.getHeader("headerName");
out.print(header); %>
for a header with more than one value!
<%
Enumeration e=request.getHeaders("headerName");
%>now enumerate (using a while loop) and print

'no worries'
[ May 25, 2003: Message edited by: Amer Khan ]
 
Fisher Daniel
Ranch Hand
Posts: 582
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
You can use :
<%= request.getHeader("Accept-Charset") %>
or
<% Enumeration enum = request.getHeaders("Accept-Charset");
while(enum.hasMoreElements())
{
String value = (String) enum.nextElement();
out.println(value);
}
%>
Correct me if i am wrong
daniel
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic