0

I started a Dynamic Web project in Eclipse and the Automatically generated directory is:

Java Resources
|-src
|  |-myPackage
|     |-.java files
|-libraries
Build
Web Content
|-META-INF
|-WEB-INF
|-index.jsp

In my index.jsp file I include a servlet:

<jsp:include page="ServletName" flush="true">

that is a java file placed under JavaResources/src/myPackage, but i get an error because that file is supposed to be placed under Web Content. How can I change the expected path? Thank you.

JB Nizet
  • 678,734
  • 91
  • 1,224
  • 1,255

1 Answers1

0

The page attribute is supposed to be the path of a resource of your webapp. A resource can be a static resource, a JSP, or the path of a servlet of your webapp. It has nothing to do with the name of the java file of your servlet. See http://docs.oracle.com/javaee/1.3/tutorial/doc/JSPIntro8.html.

So, if your servlet is mapped to /foo (thanks to the @WebServlet annotation, or to the servlet-mapping element in the web.xml), then you should use /foo as the value of he page attribute.

JB Nizet
  • 678,734
  • 91
  • 1,224
  • 1,255