Hello,
 
I am trying to figure out how ActionForm and validate()-function work. If I
returns an error (ActionErrors) from my ActionForm it fail (se below for
output). Returning null everything works fine. I thought that when returning
an error I would return to my loginpage automatically. But I dont. Anyone
who can explain to me hwo this works og give me a link with a fully
functioning example? I have looked at examples but they are for the most
parts of an example.
 
- Terje
 
Error when pressing submit in login.jsp
type Status report

message No input attribute for mapping path /struts/authenticate

description The server encountered an internal error (No input attribute for
mapping path /struts/authenticate) that prevented it from fulfilling this
request.

 
WEB.XML
<?xml version="1.0" encoding="UTF-8"?>
<!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>
 <filter>
  <filter-name>accessControl</filter-name>
  <filter-class>com.teho.servlets.AccessControlFilter</filter-class>
  <init-param>
   <param-name>loginPage</param-name>
   <param-value>/login.jsp</param-value>
  </init-param>
 </filter>
 <filter-mapping>
  <filter-name>accessControl</filter-name>
  <url-pattern>/internal/*</url-pattern>
 </filter-mapping>
 <servlet>
  <servlet-name>action</servlet-name>
  <servlet-class>org.apache.struts.action.ActionServlet</servlet-class>
  <init-param>
   <param-name>application</param-name>
   <param-value>com.teho.servlets.ApplicationResources</param-value>
  </init-param>
 </servlet>
 <servlet-mapping>
  <servlet-name>action</servlet-name>
  <url-pattern>*.do</url-pattern>
 </servlet-mapping>
</web-app>

STRUTS-CONFIG.XML:
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE struts-config PUBLIC "-//Apache Software Foundation//DTD Struts
Configuration 1.1//EN"
"http://jakarta.apache.org/struts/dtds/struts-config_1_1.dtd";>
<struts-config>
 <form-beans>
  <form-bean name="loginForm" type="com.teho.servlets.LoginForm" />
 </form-beans>
 <action-mappings>
  <action name="loginForm" type="com.teho.servlets.AuthenticateAction"
path="/struts/authenticate" />
 </action-mappings>
</struts-config>

login.jsp
...
<form name="login" method="post" action="<c:url
value="/struts/authenticate.do" />">
...
 

Reply via email to