SunQuest
           Java Help
 
Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
User Name:
Password:
Remember me
Go Back   Dev Shed ForumsProgramming LanguagesJava Help

Reply
Add This Thread To:
  Del.icio.us   Digg   Google   Spurl   Blink   Furl   Simpy   Y! MyWeb 
Thread Tools Search this Thread Rate Thread Display Modes
 
Unread Dev Shed Forums Sponsor:
Be the architects of evolution and help create the mobile internet future. It’s your move---enter to win here!
  #1  
Old May 13th, 2002, 10:20 PM
frogman frogman is offline
Junior Member
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Jun 2000
Posts: 10 frogman User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 0
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

Reply With Quote
  #2  
Old May 14th, 2002, 12:35 AM
ptinney ptinney is offline
Junior Member
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Apr 2002
Location: Modesto, CA US
Posts: 1 ptinney User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 0
Send a message via ICQ to ptinney
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.

Reply With Quote
  #3  
Old May 15th, 2002, 10:10 AM
frogman frogman is offline
Junior Member
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Jun 2000
Posts: 10 frogman User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 0
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

Reply With Quote
  #4  
Old May 15th, 2002, 11:04 AM
ptinney ptinney is offline
Junior Member
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Apr 2002
Location: Modesto, CA US
Posts: 1 ptinney User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 0
Send a message via ICQ to ptinney
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.

Reply With Quote
Reply

Viewing: Dev Shed ForumsProgramming LanguagesJava Help > Basic steps to get a servlet online


Thread Tools  Search this Thread 
Search this Thread:

Advanced Search
Display Modes  Rate This Thread 
Rate This Thread:


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
View Your Warnings | New Posts | Latest News | Latest Threads | Shoutbox
Forum Jump


Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
  
 





© 2003-2008 by Developer Shed. All rights reserved. DS Cluster 5 hosted by Hostway