I am trying to deploy a sample web app. It calls a servlet class from index.html But when I submit the details from index.html, it is unable to locate the class. I have tried various combinations in web.xml and weblogic.xml as the deployment descriptors. I am mentioning the code below. Any help would be appreciated. Index.html ---------- <FORM ACTION="/greeting/GreetingServlet" METHOD="POST"> <P>Your Name <INPUT TYPE="text" SIZE="40" NAME="name"></P> <P>Your Email <INPUT TYPE="text" SIZE="40" NAME="email"> <INPUT TYPE="submit" VALUE="Submit"></P> web.xml ------- <web-app> <servlet> <servlet-name>Registration</servlet-name> <servlet-class>GreetingServlet</servlet-class> </servlet> <servlet-mapping> <servlet-name>Registration</servlet-name> <url-pattern>*</url-pattern> </servlet-mapping> </web-app> weblogic.xml ------------ <context-root> greeting </context-root> The directory structure is as: ------------------------------ ..\temp\greeting => index.html => WEB-INF\ ==> web.xml ==> weblogic.xml ==> classes\ ===> GreetingServlet.class
Hi the folder structure should be something like ../applications/greetings why is it temp/greetings
Joined: Sep 09, 2003
Hi Rahul, sorry for being late in trying out your advice. But it really does not work. I am still stuck up at the same place. Also I guess, that it has more to do with the content of web.xml rather than the directory structure. My WL console shows GreetingServlet as one of the deployed servlet but still it fails to show up when called by index.html or even separately. Is it possible to call a simple class directly instead of going through index.html. Or is there a way to debug this small application ? I just want to get rid of this silly problem - though a first step in my learning of web application. Best Regards, Saurabh
Have you looked at u'r managed server logs, access logs and admin server logs. May be you can find more details there. As a round about way: if you have coded the service method rather then doPost in your servlet then invoke your servlet by typing the servlet url in the address bar with query parameters and see if it is getting inoked or not.