Writing Java cgi for apache.
Posted on 2009-04-30
I have a java servlet, which excepts username, password and domain values from a php file, does some authentication checks and returns a value if authentication succeds or fails using 'out.println("1") or 'out.println("0") and my php file reads these values.
Current situation: Since to run a java servlet i need a servlet container, i need to install the container in the machine where i intend to use it. But i cant do it in my present situation. Also i have to mandatorily use java as i have to extend other java classes for authentication purpose, that is the reason i have written a java servlet. I also have a apache server installed in my system.
Q1. Now since apache has a built in support for cgi, is it possible to convert this servlet into a java cgi so that it can be called by php file and can save me from installing the servlet container.
Q2.I am very new to cgi. please let me know how can i do this.
Q3.Is it possible to do this using web services? I am very new to web services also.
Q4.Which will be the best under this situation cgi or webservices?
Q5.Any tutorials for this would be of great help (writing cgi/web services in java etc). As i have to mandatorily use java.