File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Tompcat - calling servlet from JSP

 
m asif
Greenhorn
Posts: 6
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi everyone,
I am getting no page found error while calling servlet from jsp page.
here is jsp code:
<form name="Form"
action="http://localhost:8080/Asifweb/asif/Servlet1"
method="POST">
....
<input type="hidden" name="action" value="ADD">
<input type="submit" name="Submit" value="Add">
</form>
following is WAR file configuration:
web.xml path: web-inf/
jsp Path: web-inf/
servlet path: web-inf/classes/asif/
URL_MAPPING
<web-app>
<servlet>
<servlet-name>debugjsp</servlet-name>
<servlet-class>org.apache.jasper.servlet.JspServlet</servlet-class>
<init-param>
<param-name>jspCompilerPlugin</param-name>
<param-value>com.borland.jbuilder.webserverglue.tomcat.jsp.JasperSunJavaCompiler</param-value>
</init-param>
<load-on-startup>3</load-on-startup>
</servlet>
<servlet>
<servlet-name>servlet1</servlet-name>
<servlet-class>asif.Servlet1</servlet-class>
</servlet>
<servlet-mapping>
<servlet-name>debugjsp</servlet-name>
<url-pattern>*.jsp</url-pattern>
</servlet-mapping>
<servlet-mapping>
<servlet-name>servlet1</servlet-name>
<url-pattern>/servlet1</url-pattern>
</servlet-mapping>
</web-app>
 
Mike Curwen
Ranch Hand
Posts: 3695
IntelliJ IDE Java Ubuntu
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
servlet1 and Servlet1 are two different things (the case of the first letter).

Also, it's WEB-INF, not web-inf (and yes, it absolutely makes a difference)
 
m asif
Greenhorn
Posts: 6
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Mike your are the Man!!! thanks for telling me very basic.
 
I agree. Here's the link: http://aspose.com/file-tools
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic