|
|
|
| |||||||||
![]() |
|
|
«
Previous Thread
|
Next Thread
»
|
Thread Tools | Search this Thread | Rate Thread | Display Modes |
|
|
|
Be the architects of evolution and help create the mobile internet future. It’s your move---enter to win here! |
|
#1
|
|||
|
|||
|
Basic steps to get a servlet online
I have tried all day to understand this. I only want to understand how to get a simple servlet with the default Tomcat config working through Apache. I have everything installed, and the sample servlets in the webapps directory work fine. Here are my specs:
OS: Debian Sid apache version: 1.3.23 tomcat version: 3.3 I have both tomcat and apache installed in /usr/local. I have my simple .class file in /usr/local/tomcat/webapps/. The tutorial at [url]http://developer.java.sun.com/developer/onlineTraining/Programming/BasicJava1/servlet.html leaves alot to be desired. Maybe I am just sick of looking for the answer, but I would appreciate some tips. With the location of my simple servlet, where would I put an html form to reference this servlet, and what path should I specify in the "ACTION= " section of the form? Once I understand how this mess works, I can start learning how to write servlets. Thanks for any help. Bob |
|
#2
|
|||
|
|||
|
The problem, is you didn't quite get the right folder. For a servlet that will be accessed like http://192.168.0.1:8080/servlet/myservlet
the file myservlet.class will need to be in /tomcat-root/webapps/ROOT/WEB-INF/classes of course replace tomcat-root with the location of your tomcat directory. I had the same problem when I first started, here is a link to the page I used to figure out where things go. URL Oh, and be sure to shutdown the server and restart it if you just copy the file into the directory. |
|
#3
|
|||
|
|||
|
That helped
Thanks for the link. It explained enough for me to get the standalone server working. Now I just need to figure out how to make it accessible from anywhere. I am looking at the tomcat.conf to see if I can do this.
It seems like I would want to define a directory under which all my servlets can placed. I'll get it figured out, but its been confusing. Thanks again. Bob |
|
#4
|
|||
|
|||
|
Are you using mod_jk? I found a couple web pages that go over implementing Tomcat with the requests being routed through Apache. Now I just need to implement it once I finish up with my servlet project.
Map URLs to Servlets for Friendly Surfing and then the mod_jk if you aren't familiar with it mod_jk I hope these help. |
![]() |
| Viewing: Dev Shed Forums > Programming Languages > Java Help > Basic steps to get a servlet online |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|
|
|