Erro ao chamar uma action no WebWork

1 resposta
M

Ao chamar a action acontece o seguinte erro

There is no Action mapped for namespace / and action name AnoNascimento. Check if there is such an action name with such namespace defined in the xwork.xml and also if such an action class exists. Check also the log to see if the action class is successfully loaded. - [unknown location]
	com.opensymphony.xwork.DefaultActionProxy.<init>(DefaultActionProxy.java:75)
	com.opensymphony.xwork.DefaultActionProxyFactory.createActionProxy(DefaultActionProxyFactory.java:46)
	com.opensymphony.webwork.dispatcher.DispatcherUtils.serviceAction(DispatcherUtils.java:264)
	com.opensymphony.webwork.dispatcher.ServletDispatcher.service(ServletDispatcher.java:111)
	javax.servlet.http.HttpServlet.service(HttpServlet.java:803)

meu xwork.xml

<!DOCTYPE xwork PUBLIC "-//OpenSymphony Group//XWork 1.0//EN" "http://www.opensymphony.com/xwork/xwork-1.0.dtd">
<xwork>
	<include file="webwork-default.xml" />
	<package name="default" extends="webwork-default">
	
		<default-interceptor-ref name="defaultStack" />
		<action name="AnoNascimento" class="prjaulas.CalculaAnoNascimento">
			<result name="error" type="dispatcher">
				leIdade.jsp
			</result>
			<result name="success" type="dispatcher">
				mostraAno.jsp
			</result>
		</action>
	</package>
</xwork>

meu web.xml

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

<web-app  xmlns="http://java.sun.com/xml/ns/j2ee" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" id="WebApp_ID" version="2.4" xsi:schemaLocation="http://java.sun.com/xml/ns/j2ee http://java.sun.com/xml/ns/j2ee/web-app_2_4.xsd">
	<display-name>
	prjaulas</display-name>
	<welcome-file-list>
		<welcome-file>index.html</welcome-file>
		<welcome-file>index.htm</welcome-file>
		<welcome-file>index.jsp</welcome-file>
		<welcome-file>default.html</welcome-file>
		<welcome-file>default.htm</welcome-file>
		<welcome-file>default.jsp</welcome-file>
	</welcome-file-list>
	
	<servlet>
		<servlet-name>webwork</servlet-name>
		<servlet-class>com.opensymphony.webwork.dispatcher.ServletDispatcher</servlet-class>
		<load-on-startup>1</load-on-startup>
	</servlet>
	
	<servlet-mapping>
		<servlet-name>webwork</servlet-name>
		<url-pattern>*.action</url-pattern>
	</servlet-mapping>
	
	<jsp-config>
		<taglib>
			<taglib-uri>webwork</taglib-uri>
			<taglib-location>/WEB-INF/lib/webwork-2.2.6.jar</taglib-location>
		</taglib>
	 </jsp-config>
	
</web-app>

O que eu configurei de errado? Estou usando um exemplo do Marcelo Martins

1 Resposta

M

Alguém?

Criado 23 de fevereiro de 2008
Ultima resposta 23 de fev. de 2008
Respostas 1
Participantes 1