aspose file tools*
The moose likes Servlets and the fly likes setting a servlet Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » Servlets
Bookmark "setting a servlet" Watch "setting a servlet" New topic
Author

setting a servlet

Dan Drillich
Ranch Hand

Joined: Jul 09, 2001
Posts: 1180
Hi,
I�m trying to convince my first servlet to work ;-)
My weblogic 5.1 serves the following � http://ny1715:7001/mywebapp/index.html
index.html has the following form �
<form action="/mywebapp/servlet/GreetingServlet" method="post">
In the directory - mywebapp\WEB-INF\classes I have the class GreetingServlet.class
The mywebapp\WEB-INF\web.xml contains the following �
<servlet>
<servlet-name>Registration</servlet-name>
<servlet-class>GreetingServlet</servlet-class>
</servlet>
When submitting the form I get a 404 page.
Any ideas?
Thanks,
Dan

William Butler Yeats: All life is a preparation for something that probably will never happen. Unless you make it happen.
BJ Grau
Ranch Hand

Joined: Jul 10, 2001
Posts: 234
I have never used Weblogic, so this might not be much help - but are you sure you are using port 7001? Also, does Weblogic have some sort of default page that comes up when you go to http://localhost:<portnumber>? Try seeing if it works first.
Dan Drillich
Ranch Hand

Joined: Jul 09, 2001
Posts: 1180
Hi,
http://ny1715:7001/mywebapp/index.html served the initial page.
The servlet wasn't reached.
Thanks,
Dan
Manohar Karamballi
Ranch Hand

Joined: Jul 17, 2001
Posts: 227
Hai Drich!
In addition to what u have given in xml file u also need to give following info,,,
<servlet-mapping>
<servlet-name>
Servlet Name goes here
</servlet-name>
<url-pattern>
URI u want
</url-pattern>
</servlet-mapping>

and then in action of form change URL to /UR applcation/URI u want .
Also check whether web component for ur application is registered in config.xml file of ur server
mocca az
Ranch Hand

Joined: Mar 07, 2001
Posts: 93
With Weblogic you also need to register servlet in weblogic.properties file. This doesn't just apply for servlets, any beans also need to ber registered.
Tim Holloway
Saloon Keeper

Joined: Jun 25, 2001
Posts: 16250
    
  21

weblogic.properties is for WebLogic 5.1. The XML form took over in WLS 6.


Customer surveys are for companies who didn't pay proper attention to begin with.
 
It is sorta covered in the JavaRanch Style Guide.
 
subject: setting a servlet