wood burning stoves 2.0*
The moose likes Servlets and the fly likes How to use server environment variables in JSP Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of OCA/OCP Java SE 7 Programmer I & II Study Guide this week in the OCPJP forum!
JavaRanch » Java Forums » Java » Servlets
Bookmark "How to use server environment variables in JSP" Watch "How to use server environment variables in JSP" New topic
Author

How to use server environment variables in JSP

Raghu Jamwal
Greenhorn

Joined: Dec 28, 2000
Posts: 8
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

Joined: Apr 18, 2000
Posts: 6
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

Joined: Dec 28, 2000
Posts: 8
Thanx a lot.It helped.
 
Consider Paul's rocket mass heater.
 
subject: How to use server environment variables in JSP