You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@tomcat.apache.org by Matt Louden <ap...@yahoo.com> on 2004/06/05 20:38:27 UTC

JSP, Servlet, and Java Classes location in Tomcat

 
In tomcat, I want to know JSP files, Servlets, and Java classes 
should put in different locations:
I put web.xml in the following:
C:\jakarta-tomcat-4.1.30\webapps\proj1\WEB-INF
I put all JSP files in the following:
C:\jakarta-tomcat-4.1.30\webapps\proj1
I put all servlet files in the following:
C:\jakarta-tomcat-4.1.30\webapps\proj1\WEB-INF\classes
I put all Java classes in the following with package proj1:
C:\jakarta-tomcat-4.1.30\webapps\proj1\WEB-INF\classes\proj1

When I execute JSP files, it has HTTP error 404, file not found.
The content of web.xml is:
<?xml version="1.0" encoding="ISO-8859-1"?>
<!DOCTYPE web-app
    PUBLIC "-//Sun Microsystems, Inc.//DTD Web Application 2.3//EN"
    "http://java.sun.com/dtd/web-app_2_3.dtd">
<web-app>
  <display-name>proj1</display-name>
  <description>
 proj1
  </description>
  
      <servlet-mapping>
          <servlet-name>invoker</servlet-name>
          <url-pattern>/*</url-pattern>
    </servlet-mapping>
</web-app>

Please advise. thanks!!!

		
---------------------------------
Do you Yahoo!?
Friends.  Fun. Try the all-new Yahoo! Messenger

Re: JSP, Servlet, and Java Classes location in Tomcat

Posted by Matt Louden <ap...@yahoo.com>.
Thanks you QM!
 
I just followed the example to use invoker, I don't understand what is that. So whats your suggestions? When I removed web.xml, the JSP is running, but servlet no longer runs.
I want to run both JSP and servlet. Please advise. Thanks!!

QM <qm...@brandxdev.net> wrote:
On Sat, Jun 05, 2004 at 11:38:27AM -0700, Matt Louden wrote:
: In tomcat, I want to know JSP files, Servlets, and Java classes 
: should put in different locations:

This breaks down into:
1/ the servlet spec (where you put classes, JARs, web.xml, etc)

2/ your app's architecture (JSPs, servlet URI mappings -- see a 
few texts/articles on best practices).


Your specific problem is this:

: 
: invoker
: /*
^^^^

You're mapping the invoker to _all_ URIs. The JSPs themselves will
never be called. If you want to use the invoker, map it to a deeper
URI, such as "/something/*"


Also, I feel a certain obligation to warn you against using the
invoker, but that's your choice.

-QM

-- 

software -- http://www.brandxdev.net
tech news -- http://www.RoarNetworX.com


---------------------------------------------------------------------
To unsubscribe, e-mail: tomcat-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: tomcat-user-help@jakarta.apache.org

		
---------------------------------
Do you Yahoo!?
Friends.  Fun. Try the all-new Yahoo! Messenger

Re: JSP, Servlet, and Java Classes location in Tomcat

Posted by QM <qm...@brandxdev.net>.
On Sat, Jun 05, 2004 at 11:38:27AM -0700, Matt Louden wrote:
: In tomcat, I want to know JSP files, Servlets, and Java classes 
: should put in different locations:

This breaks down into:
1/ the servlet spec (where you put classes, JARs, web.xml, etc)

2/ your app's architecture (JSPs, servlet URI mappings -- see a 
   few texts/articles on best practices).


Your specific problem is this:

:       <servlet-mapping>
:           <servlet-name>invoker</servlet-name>
:           <url-pattern>/*</url-pattern>
                        ^^^^

You're mapping the invoker to _all_ URIs.  The JSPs themselves will
never be called.  If you want to use the invoker, map it to a deeper
URI, such as "/something/*"


Also, I feel a certain obligation to warn you against using the
invoker, but that's your choice.

-QM

-- 

software  -- http://www.brandxdev.net
tech news -- http://www.RoarNetworX.com


---------------------------------------------------------------------
To unsubscribe, e-mail: tomcat-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: tomcat-user-help@jakarta.apache.org