Then if apache is on 8080 instead of 80, then tomcat can run on 8088. port forward any to 8088 and remember to change the tomcat file for port hosting, tomcat6=server.xml
Code: Select all
<Connector port="8088" protocol="HTTP/1.1"
connectionTimeout="20000"
redirectPort="8443" />
to access it, if you have your tomcat setup correctly, you can goto any browser and type:
Code: Select all
http://127.0.0.1:8088/Printfile/test.html
the program then reads the sent variables and then finds the absolute path your servlet is on to teach you about pathing, and saves the file into the "webapps/Printfile/Printfile_output.html" location.
Code: Select all
String uPath=getServletConfig().getServletContext().getRealPath("")+File.separator+"Printfile_output.html";
Here is a zip file of the servlet and java compiled to a class. Remember if you want to edit or use this, install JDK from the web (google JDK for winx86 or x86 whichever you have), set your paths correctly, have tomcat installed, make sure all of the debug otions in web.xml are uncommented properly for learning and not a normal commercial deployment. Also make sure all of your PATHS and such for JAVA_HOME and CATALINA_HOME are properly setup (google it)
http://www.supercala.net/tuts/tomcat/Printfile.zip