Olá pessoal,
estou fazend um exemplo de validator do Struts
e está me dando o erro na pagina abaixo na hora
que carrega no browser:
na linha :
<html:form action =“registrar-submit”>
–pagina
<%@ taglib uri="http://struts.apache.org/tags-logic" prefix="logic" %>
<%@ taglib uri="http://struts.apache.org/tags-html" prefix="html" %>
<%@ taglib uri="http://struts.apache.org/tags-bean" prefix="bean" %>
<html:html>
<head>
<title> Titulo </title>
<LINK href ="estilo.css" type="text/css" rel="stylesheet">
<html:base/>
</head>
<body bgcolor="white">
<html:form action ="registrar-submit">
<html:hidden property="action"/>
<br>
<table border ="0" width="80%" align="center">
<tr> <td align="left">
Nome :
</td><td align="left">
<html:text property="nome" size="30" maxlength="30"/>
</td><tr>
<tr><td align="left">
Fone :
</td><td align="left">
<html:text property="fone" size="20" maxlength="20"/>
</td><tr>
<tr><td align="left">
Email :
</td><td align="left">
<html:text property="email" size="60" maxlength="60"/>
</td></tr>
<tr><td colspan="2" align="center">
<html:submit property="submit">Salvar
</html:submit>
</td></tr>
</table>
<table border="0" width="80%" align=center>
<tr>
<td align="left">
<logic:messagesPresent>
Erro
<ul>
<html:messages id="error">
<li> <bean:write name ="error" /></li>
</html:messages>
</ul>
</logic:messagesPresent>
</td>
</tr>
</table>
</html:form>
</body>
</html:html>
–erro
HTTP Status 500 -
--------------------------------------------------------------------------------
type Exception report
message
description The server encountered an internal error () that prevented it from fulfilling this request.
exception
org.apache.jasper.JasperException: Module 'null' not found.
org.apache.jasper.servlet.JspServletWrapper.handleJspException(JspServletWrapper.java:460)
org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:373)
org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:329)
org.apache.jasper.servlet.JspServlet.service(JspServlet.java:265)
javax.servlet.http.HttpServlet.service(HttpServlet.java:803)
root cause
java.lang.NullPointerException: Module 'null' not found.
org.apache.struts.taglib.TagUtils.getModuleConfig(TagUtils.java:755)
org.apache.struts.taglib.TagUtils.getModuleConfig(TagUtils.java:735)
org.apache.struts.taglib.html.FormTag.lookup(FormTag.java:796)
org.apache.struts.taglib.html.FormTag.doStartTag(FormTag.java:467)
org.apache.jsp.validator.registrar_jsp._jspService(registrar_jsp.java:108)
org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:98)
javax.servlet.http.HttpServlet.service(HttpServlet.java:803)
org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:331)
org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:329)
org.apache.jasper.servlet.JspServlet.service(JspServlet.java:265)
javax.servlet.http.HttpServlet.service(HttpServlet.java:803)
note The full stack trace of the root cause is available in the Apache Tomcat/5.5.25 logs.
--------------------------------------------------------------------------------
Apache Tomcat/5.5.25
–config
<?xml version="1.0" encoding="ISO-8859-1" ?>
<!DOCTYPE struts-config PUBLIC
"-//Apache Software Foundation//DTD Struts Configuration 1.3//EN"
"http://struts.apache.org/dtds/struts-config_1_3.dtd">
<struts-config>
<form-beans>
<!-- form bean -->
<form-bean name="registrarForm" type="br.com.wincomp.curso.RegistrarForm" />
</form-beans>
<!-- Definições dos mapeamentos das ações -->
<action-mappings>
<action path="/registrar" forward path="/registrar.jsp" />
<action path="/registrar-submit"
type="br.com.wincomp.curso.RegistrarAction"
name ="registrarForm"
scope="request"
validate="true"
cancellable="true"
input="input"
><forward name="input" path="/registrar.do"/>
<forward name="success" path ="/registrado.jsp"/>
</action>
</action-mappings>
<plug-in className="org.apache.struts.validator.ValidatorPlugIn">
<set-property property "pathnames" value="/org/apache/struts/validator/validator-rules-compressed.xml,
/WEB-INF/validator/validation.xml,
/WEB-INF/validator/validation-bundles.xml,
/WEB-INF/validator/struts-config-i18nVariables.xml,
/WEB-INF/validator/validation-type.xml,
/WEB-INF/validator/validation-validwhen.xml"/>
<set-property property="stopOnFirstError" value ="true" />
</plug-in>
</struts-config>
–web.xml
<?xml version="1.0" encoding="ISO-8859-1"?>
<!DOCTYPE web-app PUBLIC
"-//Sun Microsystems, Inc.//DTD Web Application 2.3//EN"
"http://java.sun.com/dtd/web-app_2_3.dtd">
<web-app>
<display-name>Struts Blank Application</display-name>
<!-- Standard Action Servlet Configuration -->
<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/validator/struts-config.xml</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>
</web-app>