struts-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Craig R. McClanahan" <>
Subject Re: Running the Struts Example under Apache
Date Thu, 13 Jul 2000 19:09:28 GMT
Could you take a look at the Tomcat log files to see if the database servlet
and controller servlet were actually initialized?  Depending on which build
of Tomcat you are running, there were some problems with load-on-startup
servlets being processed.

Also, see below for some other notes.

Nick Roberts wrote:

> Hi,
> I have installed the struts-documentation and struts-example
> applications under tomcat and they both work fine.
> I can also access the struts-documentation application fine via Apache
> but the struts-example simply displays a message saying the database
> could not be loaded.
> The error is because index.jsp cannot retrieve the appropriate attribute
> from the application context. As this was added to the application
> context by the DatabaseServlet init method why is index.jsp unable to
> retrieve it ?
> What is different about running under Apache that causes the JSP page
> and DatabaseServlets to think they are in separate application whereas
> under Tomcat they are happy to believe they are in the same application
> ?
> My settings from httpd.conf are based on those in the example in the
> Tomcat users guide and are below
> Any suggestions much appreciated,
> Nick Roberts
> Silverplatter Information Ltd
> #
> # Mounting a servlet context for the struts examples:
> #
> Alias /struts-example e:\jakarta-tomcat\webapps\struts-example
> <Directory "e:\jakarta-tomcat\webapps\struts-example">
>     Options Indexes FollowSymLinks
>     DirectoryIndex index.jsp
> </Directory>
> <Location /struts-example/WEB-INF/>
>     AllowOverride None
>     deny from all
> </Location>
> <LocationMatch /struts-example/*.jsp>
>     SetHandler jserv-servlet
> </LocationMatch>

I've never actually tried using <LocationMatch> like this -- the default way
that Tomcat generates its integration file includes a global

    AddHandler jserv-servlet *.jsp


Regardless of which way you do the JSP forwarding, you are also going to
need to add forwarding for the "*.do" extension that is used for the
controller servlet submits.  The simplest way would be another line:

    AddHandler jserv-servlet *.do

which does it globally, but the LocationMatch trick ought to work here as

> ApJServMount /struts-example/servlet /struts-example
> ApJServMount /servlet /ROOT


View raw message