This week's book giveaway is in the Jython/Python forum.
We're giving away four copies of Murach's Python Programming and have Michael Urban and Joel Murach on-line!
See this thread for details.
Win a copy of Murach's Python Programming this week in the Jython/Python forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic

newbie a simple one- cant invoke servlet  RSS feed

 
andy brookes
Greenhorn
Posts: 6
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Because I�m new to java I might not miss details but other things glaringly obvious to you, I might not be able to see, here�s the problem.


My web hosting is using resin 2.1 on windows, and I am using 2.1.17 on windows on my home pc system.

I have several single jsp�s working on my web site. One jsp connects to a mysql database on the web hosting system ok, so that means the system can find the jar file in myhostfolder/WEB-INF/classes; and all the jsps work so my folder must seen by the
Jdk or equivalent of the web host system.

I believe my hosting space is like a subdirectory of the doc folder in resin 2.1 on my system, because I only have one folder to work in on my web hosting.

The problem: I have a simple servlet which I put as simpleservlet.java in WEB-INF/classes on my home pc system & it worked, but it won�t work on my web hosting & I used the same URL pattern and servlet name, mapping in the web.xml inside WEB-INF.

What I can not understand is how can the jar file be found and the jsp�s work but the servlet doesn�t. I don�t have access to anything on the web hosting system by the way except my own folder, and mysql etc through the control panel. I.e. I have read about resin.conf etc but can�t touch it on the hosting site. Any pointers as to why the servlet wouldn�t work. My guess is the link to invoke it. I used mappath from coldtags and got
D:\websites\myhostfolder; yes even tag libraries work on the web hosting, but servlets don�t, any pointers?
 
Bear Bibeault
Author and ninkuma
Marshal
Posts: 65830
134
IntelliJ IDE Java jQuery Mac Mac OS X
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
First things first: is the servlet class in the default package? If so, fix that and see what happens. We'll take it from there if there's still an issue.
 
Amit Ghorpade
Bartender
Posts: 2856
10
Fedora Firefox Browser Java
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi andy brookes
just check first what Bear asked you. But just to add on

I have a simple servlet which I put as simpleservlet.java in WEB-INF/classes on my home pc

in the above quote you said that you put the simpleservlet.java file in classes directory, I think you need to put the .class file there. Or maybe its just a typing mistake.


Hope this helps
 
Siddharth Naik
Ranch Hand
Posts: 35
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Are you getting any specific error? Did you check for any clues in server log?
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!