File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
The moose likes Servlets and the fly likes Configure to include servlet problem Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » Servlets
Bookmark "Configure to include servlet problem" Watch "Configure to include servlet problem" New topic
Author

Configure to include servlet problem

michael yue
Ranch Hand

Joined: Nov 20, 2003
Posts: 204
hi I just started using java web service and is having problem running servlets.
I configure my web.xml file to look like this
<?xml version="1.0"?>
<web-app version="2.4" xmlns="http://java.sun.com/xml/ns/j2ee" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://java.sun.com/xml/ns/j2ee http://java.sun.com/xml/ns/j2ee/web-app_2_4.xsd">
<!-- General description of the PM Application -->
<display-name>Application</display-name>
<description>
This is the Java application
</description>
<servlet>
<display-name>MercProServlet</display-name>
<servlet-name>MercProServlet</servlet-name>
<servlet-class>MercProServlet</servlet-class>
</servlet>
<servlet-mapping>
<servlet-name>MercProServlet</servlet-name>
<url-pattern>/MercProServlet</url-pattern>
</servlet-mapping>
</web-app>

I put the servlet in dir
D:\jwstutorial13\examples\web\scrmypm\build\WEB-INF\classes

I try to invoke the servlet frm a form ie
<FORM method="post" action="/MercProServlet">
but it return resource not available
my jsp is in D:\jwstutorial13\examples\web\scrmypm\build
Using jsp with beans seems to be working fine.
What am I doing wrong? Help.
Balaji Loganathan
author and deputy
Bartender

Joined: Jul 13, 2001
Posts: 3150
This is more like servlet related problem, moving this thread to the Servlets Forum where you may get some help.
William Brogden
Author and all-around good cowpoke
Rancher

Joined: Mar 22, 2000
Posts: 12783
    
    5

Never never never try to use a class not in a defined package in serious servlets or JSP work. The JVM may be trying to load it from the "current directory" - something you have no control over. Define a package, put the compiled class in the right place according to the package.

Bill
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Configure to include servlet problem