Hi,
I am new to this struts.I am making a new
application on after make some changes in the given struts examples.I made
two classes one is like a LoginForm.java as in examples and the another class is
to see some details filled by the user.I am compiling those classes in to the
same package as in examples i.e org.apache.struts.example.
I created a jsp page which have a text box and a
submit button.I want that after submitting this form it should the login.jsp
file but when i click on that button it is giving me the following
error.
Error: 400Location:/contest/jsp/logonForm.doInvalid path /jsp/logonForm was requested
Can anybody tell me that what's the problem and how
can i configure it.I am attching all the files with this mail which i used in
this application.
Any help regarding this will be
appretiated.
Thanks
Amit Kaushik
|
<?xml version="1.0" encoding="ISO-8859-1"?> <!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> <!-- Database Initialization Servlet Configuration --> <servlet> <servlet-name>database</servlet-name> <servlet-class>org.apache.struts.example.DatabaseServlet</servlet-class> <init-param> <param-name>debug</param-name> <param-value>2</param-value> </init-param> <load-on-startup>1</load-on-startup> </servlet> <!-- Action Servlet Configuration --> <servlet> <servlet-name>action</servlet-name> <servlet-class>org.apache.struts.action.ActionServlet</servlet-class> <init-param> <param-name>application</param-name> <param-value>org.apache.struts.example.ApplicationResources</param-value> </init-param> <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> <init-param> <param-name>validate</param-name> <param-value>true</param-value> </init-param> <load-on-startup>2</load-on-startup> </servlet> <!-- Action Servlet Mapping --> <servlet-mapping> <servlet-name>action</servlet-name> <url-pattern>*.do</url-pattern> </servlet-mapping> <!-- The Welcome File List --> <welcome-file-list> <welcome-file>index.jsp</welcome-file> </welcome-file-list> <!-- Application Tag Library Descriptor --> <taglib> <taglib-uri>/WEB-INF/app.tld</taglib-uri> <taglib-location>/WEB-INF/app.tld</taglib-location> </taglib> <!-- Struts Tag Library Descriptor --> <taglib> <taglib-uri>/WEB-INF/struts.tld</taglib-uri> <taglib-location>/WEB-INF/struts.tld</taglib-location> </taglib> </web-app>
<?xml version="1.0" encoding="ISO-8859-1" ?> <!DOCTYPE struts-config PUBLIC "-//Apache Software Foundation//DTD Struts Configuration 1.0//EN" "http://jakarta.apache.org/struts/dtds/struts-config_1_0.dtd"> <!-- This is the Struts configuration file for the example application, using the proposed new syntax. NOTE: You would only flesh out the details in the "form-bean" declarations if you had a generator tool that used them to create the corresponding Java classes for you. Otherwise, you would need only the "form-bean" element itself, with the corresponding "name" and "type" attributes. --> <struts-config> <!-- ========== Form Bean Definitions =================================== --> <form-beans> <!-- Logon form bean --> <form-bean name="logonForm" type="org.apache.struts.example.EntryForm"/> <!-- Registration form bean --> <form-bean name="registrationForm" type="org.apache.struts.example.RegistrationForm"/> <!-- Subscription form bean --> <form-bean name="subscriptionForm" type="org.apache.struts.example.SubscriptionForm"/> </form-beans> <!-- ========== Global Forward Definitions ============================== --> <global-forwards> <forward name="logon" path="/logon.jsp"/> <forward name="success" path="/mainMenu.jsp"/> </global-forwards> <!-- ========== Action Mapping Definitions ============================== --> <action-mappings> <!-- Edit user registration --> <action path="/editRegistration" type="org.apache.struts.example.EditRegistrationAction" name="registrationForm"> <forward name="success" path="/registration.jsp"/> </action> <!-- Edit mail subscription --> <action path="/editSubscription" type="org.apache.struts.example.EditSubscriptionAction" name="subscriptionForm"> <forward name="failure" path="/mainMenu.jsp"/> <forward name="success" path="/subscription.jsp"/> </action> <!-- Process a user logoff --> <action path="/logoff" type="org.apache.struts.example.LogoffAction"> <forward name="success" path="/index.jsp"/> </action> <!-- Process a user logon --> <action path="/logon" type="org.apache.struts.example.EntryForm" name="logonForm" input="/logon.jsp"> </action> <!-- Save user registration --> <action path="/saveRegistration" type="org.apache.struts.example.SaveRegistrationAction" name="registrationForm" input="/registration.jsp"/> <!-- Save mail subscription --> <action path="/saveSubscription" type="org.apache.struts.example.SaveSubscriptionAction" name="subscriptionForm" input="/subscription.jsp"> <forward name="success" path="/editRegistration.do?action=Edit"/> </action> <!-- The standard administrative actions available with Struts --> <!-- These would be either omitted or protected by security --> <!-- in a real application deployment --> <action path="/admin/addFormBean" type="org.apache.struts.actions.AddFormBeanAction"/> <action path="/admin/addForward" type="org.apache.struts.actions.AddForwardAction"/> <action path="/admin/addMapping" type="org.apache.struts.actions.AddMappingAction"/> <action path="/admin/reload" type="org.apache.struts.actions.ReloadAction"/> <action path="/admin/removeFormBean" type="org.apache.struts.actions.RemoveFormBeanAction"/> <action path="/admin/removeForward" type="org.apache.struts.actions.RemoveForwardAction"/> <action path="/admin/removeMapping" type="org.apache.struts.actions.RemoveMappingAction"/> </action-mappings> </struts-config>