I have a problem which arose when I merged several webapplications into a single ROOT.war, namely that I get the dreaded

javax.servlet.jsp.JspException: Cannot find ActionMappings or ActionFormBeans collection

when I deploy the EAR file containing the above WAR to JBoss 3.0.6. My problem is that this code works fine when developing with Resin directly in the source code, so I cannot replicate this outside JBoss.

Both struts-config.xml and web.xml validate.

I have now spent some time with the Eclipse debugger to see if I could get answers to the following questions:

* Is the file read at all?
* Where can I push a button to make Struts dumps its configuration?
* Is the /find-recipients-for-donor correctly configured with the 1.1b3 struts (it was created for 1.0.2).

referenced by the following snippet in search/enter-donor-data.jsp (which before the merge was in a seperate WAR, named /enter-donor-data.jsp):

<title>Organ search</title>
<html:form action="/find-recipients-for-donor">
<table bborder=0><tr><td valign="top">
...

I would appreciate pointers - my next step would be to get a build-environment for Struts established, and modify code. I would rather not go there :)

Thanks in advance.




web.xml (just the start):
=======

<!DOCTYPE web-app
PUBLIC "-//Sun Microsystems, Inc.//DTD Web Application 2.2//EN"
"http://java.sun.com/j2ee/dtds/web-app_2_2.dtd";>

<web-app>
<!-- Standard Action Servlet Configuration (with debugging) -->
<servlet>
<servlet-name>action</servlet-name>
<servlet-class>org.apache.struts.action.ActionServlet</servlet-class>
<init-param>
<param-name>config</param-name>
<param-value>/WEB-INF/struts-config.xml</param-value>
</init-param>
<init-param>
<param-name>debug</param-name>
<param-value>2</param-value>
</init-param>
<init-param>
<param-name>detail</param-name>
<param-value>2</param-value>
</init-param>
<load-on-startup>2</load-on-startup>
</servlet>
<!-- Standard Action Servlet Mapping -->
<servlet-mapping>
<servlet-name>action</servlet-name>
<url-pattern>*.do</url-pattern>
</servlet-mapping>
<!-- The Usual Welcome File List -->
<welcome-file-list>
<welcome-file>index.jsp</welcome-file>
</welcome-file-list>
<!-- Struts Tag Library Descriptors -->
<taglib>
<taglib-uri>/tags/struts-bean</taglib-uri>
<taglib-location>/WEB-INF/struts-bean.tld</taglib-location>
</taglib>
<taglib>
<taglib-uri>/tags/struts-html</taglib-uri>
<taglib-location>/WEB-INF/struts-html.tld</taglib-location>
</taglib>
<!--
<taglib>
<taglib-uri>/tags/struts-logic</taglib-uri>
<taglib-location>/WEB-INF/struts-logic.tld</taglib-location>
</taglib>
-->
<taglib>
<taglib-uri>/tags/struts-nested</taglib-uri>
<taglib-location>/WEB-INF/struts-nested.tld</taglib-location>
</taglib>
<taglib>
<taglib-uri>/tags/struts-tiles</taglib-uri>
<taglib-location>/WEB-INF/struts-tiles.tld</taglib-location>
</taglib>
<!-- JDBC DataSources (java:comp/env/jdbc) -->
<!-- <taglib>
<taglib-uri>/display</taglib-uri>
<taglib-location>/WEB-INF/lib/display.jar</taglib-location>
</taglib>
-->
<taglib>
<taglib-uri>http://jakarta.apache.org/taglibs/display</taglib-uri>
<taglib-location>/WEB-INF/lib/display.jar</taglib-location>
</taglib>
<taglib>
<taglib-uri>http://jakarta.apache.org/taglibs/datetime-1.0</taglib-uri>
<taglib-location>/WEB-INF/datetime.tld</taglib-location>
</taglib>
<resource-ref>
<description>The default DS</description>
<res-ref-name>jdbc/DefaultDS</res-ref-name>
<res-type>javax.sql.DataSource</res-type>
<res-auth>Container</res-auth>
</resource-ref>




struts-config.xml: (complete)
=====

<?xml version="1.0" encoding="ISO-8859-1" ?>

<!DOCTYPE struts-config PUBLIC
"-//Apache Software Foundation//DTD Struts Configuration 1.1//EN"
"http://jakarta.apache.org/struts/dtds/struts-config_1_1.dtd";>

<!--
This is a blank Struts configuration file with an example
welcome action/page and other commented sample elements.

Tiles and the Struts Validator are configured using the factory defaults
and are ready-to-use.

NOTE: If you have a generator tool to create the corresponding Java classes
for you, you could include the details in the "form-bean" declarations.
Otherwise, you would only define the "form-bean" element itself, with the
corresponding "name" and "type" attributes, as shown here.
-->


<struts-config>

<!-- ==================================== Data Source Configuration -->
<!--
<data-sources>
<data-source>
<set-property
property="autoCommit"
value="false"/>
<set-property
property="description"
value="Example Data Source Configuration"/>
<set-property
property="driverClass"
value="org.postgresql.Driver"/>
<set-property
property="maxCount"
value="4"/>
<set-property
property="minCount"
value="2"/>
<set-property
property="password"
value="mypassword"/>
<set-property
property="url"
value="jdbc:postgresql://localhost/mydatabase"/>
<set-property
property="user"
value="myusername"/>
</data-source>
</data-sources>
-->

<!-- ======================================== Form Bean Definitions -->

<form-beans>

<!-- sample form bean descriptor for an ActionForm
<form-bean
name="inputForm"
type="app.InputForm"/>
end sample -->

<!-- sample form bean descriptor for a DynaActionForm
<form-bean
name="logonForm"
type="org.apache.struts.action.DynaActionForm">
<form-property
name="username"
type="java.lang.String"/>
<form-property
name="password"
type="java.lang.String"/>
end sample -->

<form-bean name="organSearchForm"

type="org.scandiatransplant.emil.search.OrganSearchForm"/>

<form-bean name="testForm"
type="org.scandiatransplant.emil.search.TestForm"/>

</form-beans>


<!-- ================================= Global Exception Definitions -->

<global-exceptions>
<!-- sample exception handler
<exception
key="expired.password"
type="app.ExpiredPasswordException"
path="/changePassword.jsp"/>
end sample -->
</global-exceptions>


<!-- =================================== Global Forward Definitions -->

<global-forwards>
<!-- Default forward to "Welcome" action -->
<!-- Demonstrates using index.jsp to forward -->
<forward
name="welcome"
path="/Welcome.do"/>

<forward name="enter-donor-data" path="search/enter-donor-data.jsp" />
<forward name="donor-show-recipients" path="search/donor-show-recipients.jsp" />
<forward name="organ_show_recipients" path="search/organ-show-recipients.jsp" />
<forward name="resultset_as_bean" path="resultset_as_bean.jsp" />
<forward name="my_test" path="/mytest.jsp" />
<forward name="von_forne" path="/index.jsp" />
<forward name="test_result" path="/test-show.jsp" />

</global-forwards>


<!-- =================================== Action Mapping Definitions -->

<action-mappings>

<!-- Default "Welcome" action -->
<!-- Forwards to Welcome.jsp -->
<action
path="/Welcome"
type="org.apache.struts.actions.ForwardAction"
parameter="/pages/Welcome.jsp"/>

<!-- sample input and input submit actions

<action
path="/Input"
type="org.apache.struts.actions.ForwardAction"
parameter="/pages/Input.jsp"/>

<action
path="/InputSubmit"
type="app.InputAction"
name="inputForm"
scope="request"
validate="true"
input="/pages/Input.jsp"/>

end samples -->

<action path="organsearch"
type="org.scandiatransplant.emil.search.OrganSearchAction"
name="organSearchForm"
scope="request"
input="organ-search.jsp">
</action>
<action path="/find-recipients-for-donor"

type="org.scandiatransplant.emil.search.FindRecipientsForDonorAction"
name="organSearchForm"
scope="session"
input="enter-donor-data.jsp">
</action>
<!--
<action path="/mytest"
type="org.scandiatransplant.emil.search.TestAction"
name="testForm"
scope="request"
input="/mytest.jsp">
</action>
-->

</action-mappings>


<!-- ===================================== Controller Configuration -->

<controller
processorClass="org.apache.struts.tiles.TilesRequestProcessor"/>


<!-- ================================ Message Resources Definitions -->

<message-resources parameter="resources.application"/>


<!-- ======================================= Plug Ins Configuration -->

<!-- ========== Tiles plugin =================== -->
<!-- -->
<!--
This plugin initialize Tiles definition factory. This later can takes some
parameters explained here after. The plugin first read parameters from web.xml, then
overload them with parameters defined here. All parameters are optional.
The plugin should be declared in each struts-config file.
- definitions-config: (optional)
Specify configuration file names. There can be several comma
separated file names (default: ?? )
- definitions-debug: (optional)
Specify Tiles debug level.
O : no debug information
1 : debug information
2 : more debug information
- definitions-parser-details: (optional)
Specify Digester debug level. This value is passed to Digester
O : no debug information (default)
1 : debug information
2 : more debug information
- definitions-parser-validate: (optional)
Specify if xml parser should validate the Tiles configuration file.
true : validate. DTD should be specified in file header. (default)
false : no validation

The TilesPlugin class create one single definition factory shared by all struts
modules, even if the plugin is declared several times. Paths found in Tiles
definitions are relative to the main context.
-->
<!-- comment following if struts1.0.x -->
<plug-in className="org.apache.struts.tiles.TilesPlugin" >
<set-property property="definitions-config"
value="/WEB-INF/tiles-defs.xml" />
<set-property property="definitions-debug" value="0" />
<set-property property="definitions-parser-details" value="0" />
<set-property property="definitions-parser-validate" value="true" />
</plug-in>
<!-- end comment if struts1.0.x -->
<plug-in className="org.apache.struts.validator.ValidatorPlugIn">
<set-property
property="pathnames"
value="/WEB-INF/validator-rules.xml,/WEB-INF/validation.xml"/>
</plug-in>

</struts-config>

<!-- Local Variables: -->
<!-- compile-command: "rxp -sV struts-config.xml" -->
<!-- End: -->





--
Thorbjørn Ravn Andersen Scandiatransplant
Skejby Sygehus, indgang 3
+45 89 49 53 01 DK-8200 Århus N
http://biobase.dk/~tra


---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to