Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations SkipVought on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

call a servlet problem 1

Status
Not open for further replies.

tyris

Programmer
Nov 2, 2000
311
0
0
FR
well in fact i have found a begun of solution but not the entire one.

it seems that the way to call a servlet is :
"/servlet/name_of_the_class"
(in a <FORM ACTION=&quot;...&quot; METHOD=&quot;POST&quot;> or by entering the path in the navigator) (as it is written in IBM red books Servlet and JSP programming)

if i put something else the navigator answer &quot;page not found&quot; and if i use the path &quot;/servlet/name_of_the_class&quot; (in my case &quot;/servlet/ShowParameters&quot; ) , the server answer something like :

&quot; ERROR 500
An error has occured while processing
request:Message:Server caught unhandled exception from servlet[invoker]
Target Servlet: invoker
StackTrace:

Root Error-1: ShowParameters
java.lang.ClassNotFoundException: ShowParameters at .....

Wrapped Error-2: Servlet [ShowParameters]: Could not find required servlet class -
ShowParameters.class
javax.servlet.ServletException: Servlet [ShowParameters]: Could not find
required servlet class - ShowParameters.class at ....&quot;

and if i call an other servlet - that is on the same directory than the
one i tested above - in the browser with the same way
(&quot;/websphere/servlet/servlet_that_works&quot;)it works !!

Both servlet (the one that works and the one that not) are in the same directory, are both .class and are both called with the same method. but only one of them function.

this thing is getting me mad.
if you have any idea please tell me, i gonna search by my own too as always even if I'm really lost

Best regards X-),
Elise
 
Which webserver are you using?pls check mappings for servet directory and the location of your .class file.

Abhijit
 
well i'm using websphere, and for the map directory i puted the servlets folder, the default one. in the package i have some servlet that i call from a jsp directly and that works, but if i do the same with POST method it doesn't)

my class file are on the good directory because one of them is working well.. Best regards X-),
Elise
 
Hi Elice

My soln is you create a seperate application instead of using default servlet directory.make a folder for that application under defauly host.under that application folder make 2 folders servets and web.All your servlets you put in this folder.( In was under default host you create this webapplication first.make sure you select proper check boxes).Then try it with /webapp/application name/servlet.Hope this will solve your problem

Abhijit
 
yes you were right thanks for the tip (webapp/application name/servlet)! Best regards X-),
Elise
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top