связка struts+string
Вот код.
struts.xml
[COLOR="RoyalBlue"]<?xml version="1.0" encoding="UTF-8" ?>
<!DOCTYPE struts PUBLIC
"-//Apache Software Foundation//DTD Struts Configuration 2.0//EN"
"http://struts.apache.org/dtds/struts-2.0.dtd">
<struts>
<constant name="struts.enable.DynamicMethodInvocation" value="false" />
<constant name="struts.objectFactory" value="org.apache.struts2.spring.StrutsSpringObjectFactory" />
<package name="struts" namespace="/" extends="struts-default" >
<action name="addmx" class="addmx">
<result name="success">/success.jsp</result>
<result name="input">/addMatrix.jsp</result>
</action>
</package>
</struts>[/COLOR]
applicationContext.xml
[COLOR="RoyalBlue"]<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE beans PUBLIC "-//SPRING//DTD BEAN//EN" "http://www.springframework.org/dtd/spring-beans.dtd">
<beans >
<bean id="daoMx" class="dao.DaoMatrix" init-method="openConnection" destroy-method="close" />
<bean class="struts.AddMatrix" name="addmx" singleton="false">
<property name="dao" ref="daoMx"/>
</bean>
</beans>
[/COLOR]
web.xml
[COLOR="RoyalBlue"]<?xml version="1.0" encoding="UTF-8"?>
<web-app id="WebApp_9" version="2.4"
xmlns="http://java.sun.com/xml/ns/j2ee"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://java.sun.com/xml/ns/j2ee http://java.sun.com/xml/ns/j2ee/web-app_2_4.xsd">
<filter>
<filter-name>struts2</filter-name>
<filter-class>org.apache.struts2.dispatcher.FilterDispatcher</filter-class>
</filter>
<filter-mapping>
<filter-name>struts2</filter-name>
<url-pattern>/*</url-pattern>
</filter-mapping>
<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/classes/struts.xml</param-value>
</init-param>
<load-on-startup>2</load-on-startup>
</servlet>
<servlet-mapping>
<servlet-name>action</servlet-name>
<url-pattern>*.do</url-pattern>
</servlet-mapping>
<listener>
<listener-class>org.springframework.web.context.ContextLoaderListener</listener-class>
</listener>
<welcome-file-list>
<welcome-file>MainPage.jsp</welcome-file>
</welcome-file-list>
</web-app>[/COLOR]
Но Tomcat кидает ошибку 404. вот лог
04.03.2009 23:10:41 org.apache.catalina.core.AprLifecycleListener lifecycleEvent
INFO: The Apache Tomcat Native library which allows optimal performance in production environments was not found on the java.library.path: D:\Program Files\JDK\bin;.;C:\Windows\Sun\Java\bin;C:\Windows\system32;C:\Windows;C:\Windows\system32;C:\Windows;C:\Windows\System32\Wbem;C:\Program Files\Microsoft SQL Server\90\Tools\binn\;C:\Program Files\Common Files\Adobe\AGL
04.03.2009 23:10:41 org.apache.coyote.http11.Http11BaseProtocol init
INFO: Initializing Coyote HTTP/1.1 on http-8080
04.03.2009 23:10:41 org.apache.catalina.startup.Catalina load
INFO: Initialization processed in 571 ms
04.03.2009 23:10:41 org.apache.catalina.core.StandardService start
INFO: Starting service Catalina
04.03.2009 23:10:41 org.apache.catalina.core.StandardEngine start
INFO: Starting Servlet Engine: Apache Tomcat/5.5.23
04.03.2009 23:10:41 org.apache.catalina.core.StandardHost start
INFO: XML validation disabled
log4j:WARN No appenders could be found for logger (org.apache.commons.digester.Digester).
log4j:WARN Please initialize the log4j system properly.
04.03.2009 23:10:43 org.apache.catalina.core.StandardContext start
SEVERE: Error listenerStart
04.03.2009 23:10:43 org.apache.catalina.core.StandardContext start
SEVERE: Context [] startup failed due to previous errors
04.03.2009 23:10:44 org.apache.catalina.core.ApplicationContext log
INFO: org.apache.webapp.balancer.BalancerFilter: init(): ruleChain: [org.apache.webapp.balancer.RuleChain: [org.apache.webapp.balancer.rules.URLStringMatchRule: Target string: News / Redirect URL: http://www.cnn.com], [org.apache.webapp.balancer.rules.RequestParameterRule: Target param name: paramName / Target param value: paramValue / Redirect URL: http://www.yahoo.com], [org.apache.webapp.balancer.rules.AcceptEverythingRule: Redirect URL: http://jakarta.apache.org]]
04.03.2009 23:10:44 org.apache.catalina.core.ApplicationContext log
INFO: ContextListener: contextInitialized()
04.03.2009 23:10:44 org.apache.catalina.core.ApplicationContext log
INFO: SessionListener: contextInitialized()
04.03.2009 23:10:45 org.apache.catalina.core.ApplicationContext log
INFO: ContextListener: contextInitialized()
04.03.2009 23:10:45 org.apache.catalina.core.ApplicationContext log
INFO: SessionListener: contextInitialized()
04.03.2009 23:10:46 com.opensymphony.xwork2.config.providers.XmlConfigurationProvider register
INFO: Parsing configuration file [struts-default.xml]
04.03.2009 23:10:47 com.opensymphony.xwork2.config.providers.XmlConfigurationProvider register
INFO: Parsing configuration file [struts-plugin.xml]
04.03.2009 23:10:47 com.opensymphony.xwork2.config.providers.XmlConfigurationProvider register
INFO: Parsing configuration file [struts.xml]
04.03.2009 23:10:47 org.apache.struts2.config.Settings getLocale
WARNING: Settings: Could not parse struts.locale setting, substituting default VM locale
04.03.2009 23:10:48 com.opensymphony.xwork2.util.ObjectTypeDeterminerFactory <clinit>
INFO: Setting DefaultObjectTypeDeterminer as default ...
04.03.2009 23:10:48 org.apache.coyote.http11.Http11BaseProtocol start
INFO: Starting Coyote HTTP/1.1 on http-8080
04.03.2009 23:10:48 org.apache.jk.common.ChannelSocket init
INFO: JK: ajp13 listening on /0.0.0.0:8009
04.03.2009 23:10:48 org.apache.jk.server.JkMain start
INFO: Jk running ID=0 time=0/42 config=null
04.03.2009 23:10:49 org.apache.catalina.storeconfig.StoreLoader load
INFO: Find registry server-registry.xml at classpath resource
04.03.2009 23:10:49 org.apache.catalina.startup.Catalina start
INFO: Server startup in 7771 ms
Connected to server
настораживает "SEVERE: Error listenerStart", но я понятия не имею, почему так. В lib все нужные библиотеки есть. В чём беда???