*
The moose likes PHP and the fly likes How to access php _SERVER variable from Java Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Android Security Essentials Live Lessons this week in the Android forum!
JavaRanch » Java Forums » Languages » PHP
Bookmark "How to access php _SERVER variable from Java" Watch "How to access php _SERVER variable from Java" New topic
Author

How to access php _SERVER variable from Java

Eric Ford
Greenhorn

Joined: Jun 04, 2010
Posts: 17
I need to integrate a Java web app running under Tomcat 7 with a php app running under Apache Web server on the same machine. Specifically, the php app is responsible for user logins/security and I need my web app to be able to read the _SERVER variable named "REMOTE_USER" stored by php. I do not need to write to the php app or interact in any way other than reading the contents of that variable. If any one has experience doing something similar I would appreciate some tips how to accomplish this.

TIA

Eric
Eric Ford
Greenhorn

Joined: Jun 04, 2010
Posts: 17
Found the answer. It turns out that selected CGI variables (including REMOTE_USER) are available via the HttpServletRequest. In this case, there is a method (getRemoteUser()) that returns the value populated by Apache.
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: How to access php _SERVER variable from Java
 
Similar Threads
java maskeraiding as firefox - how?
request dispatching
Need To have show MAC address and IP Address In Web Application
how to make html files within a folder accessible only through jsp
Web programming questions