File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
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 Murach's Java Servlets and JSP this week in the Servlets 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.
 
With a little knowledge, a cast iron skillet is non-stick and lasts a lifetime.
 
subject: How to use server environment variables in JSP
 
Similar Threads
Setting PATH env value in Ant 1.4.1
A JSP Page is a subclass of ?
WebSphere environment variables
how to use the environment variables ?
Opening .bat files from ant