Win a copy of Think Java: How to Think Like a Computer Scientist this week in the Java in General forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

How to use server environment variables in JSP

 
Raghu Jamwal
Greenhorn
Posts: 8
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hello
I want to use environment variables in my JSP pages like HTTP_REFERER and such.How do I go about it?
Any help would be appreciated.
 
Ash
Greenhorn
Posts: 6
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
You can get the value for any environment variable that your browser returns in request object. Just add the following line of code to your jsp file.
Here is the referer page <%=request.getHeader("Referer")%>
Good luck.
 
Raghu Jamwal
Greenhorn
Posts: 8
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thanx a lot.It helped.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic