FrontController Apache / Tomcat

I'm trying to implement the FrontController design pattern from Sun. But we keep on running into problems when we port the application to apache/Tomcat structure. It works fine in a tomcat stand alone. De context is initialised and the servlet is found using the url pattern, however when we call this application from Apache the servlets aren't found. I think it has something to do with the server.xml file. Both are running on the same machine

Any suggestions please?

apache error log

[Sat Aug 04 22:17:29 2001] [error] [client 127.0.0.1] File does not exist: e:/apache/tomcat/webapps/frontcontroller/control/login

jasper.log

2001-08-04 22:17:10 - Scratch dir for the JSP engine is: E:\apache\tomcat\work\localhost_8080%2Fexamples

2001-08-04 22:17:10 - IMPORTANT: Do not modify the generated servlets

2001-08-04 22:17:20 - JspEngine --> /main.jsp

2001-08-04 22:17:20 -ServletPath: /main.jsp

2001-08-04 22:17:20 - PathInfo: null

2001-08-04 22:17:20 - RealPath: E:\apache\tomcat\webapps\frontcontroller\main.jsp

2001-08-04 22:17:20 -RequestURI: /frontcontroller/main.jsp

2001-08-04 22:17:20 -QueryString: null

2001-08-04 22:17:20 -Request Params:

2001-08-04 22:17:20 - Classpath according to the Servlet Engine is: E:\apache\tomcat\webapps\frontcontroller\WEB-INF\classes

servlet.log

2001-08-04 22:17:10 - path="/examples" :jsp: init

2001-08-04 22:17:10 - path="/frontcontroller" :jsp: init

2001-08-04 22:17:10 - path="/admin" :jsp: init

2001-08-04 22:17:10 - path="/test" :jsp: init

2001-08-04 22:17:11 - path="" :jsp: init

2001-08-04 22:17:20 - path="/frontcontroller" :jsp: init

Because he can't find the servlet there no other log files

server.xml

<Context path="/frontcontroller"

docBase="E:/apache/tomcat/webapps/frontcontroller"

debug="0"

reloadable="true"/>

Web.xml

<web-app>

<display-name>FrontController</display-name>

<servlet>

<servlet-name>MainServlet</servlet-name>

<display-name>FrontController</display-name>

<servlet-class>be.vlaanderen.sbs.frontcontroller.MainServlet</servlet-class>

</servlet>

<servlet-mapping>

<servlet-name>MainServlet</servlet-name>

<url-pattern>/control/*</url-pattern>

</servlet-mapping>

</web-app>

[2548 byte] By [stockmry] at [2007-9-26 3:02:06]
# 1

Is Apache-Tomcat working fine with Tomcat examples ?

If not you should have a look to the mod_jk documentation of Tomcat (jakarta-tomcat/doc/mod_jk-howto.html).

Else ... are you using Tomcat with an application server ?

I had a similar problem when running Tomcat embedded in JBoss, mod_jk.conf-auto was not generated by Tomcat anymore and I had to add context myself ...

hope this helps.

jerome.

delattrj at 2007-6-29 11:00:46 > top of Java-index,Other Topics,Patterns & OO Design...
# 2
Also, have you checked out Struts? It sounds like it would do what you're trying.
swatdba at 2007-6-29 11:00:46 > top of Java-index,Other Topics,Patterns & OO Design...
# 3
Indeed struts offers the same however I would like to have this working. The problem is that I can't seem to find out how to make everything behind '/control/*' to point to one servlet? Any help?
stockmry at 2007-6-29 11:00:46 > top of Java-index,Other Topics,Patterns & OO Design...