|
|
| HTTP Status 404 - /web/login/showLogin.action Error in Struts 2 |
Expert:Kapil
Hi Everyone
I am using the following version for my project: Tomcat 6.0.16 Eclipse 3.4 Struts 2
Now my question is I am trying to implement the login application which is explained in the Roseindia website but I am using the differnet directory structure. Here is the directory structure of my project lib/prod/all the jars required for struts and all other thing web(web project starts from here)/src/all the java files /WebContent /css/stylesheet files /META-INF /WEB-INF /struts.xml /web.xml /login.xml /pages /index.jsp /login.jsp /loginSuccess.jsp
I have configured the tomcat server using eclipse and Now when I am trying to right click on the index.jsp and give it the command run on server I can see the web-page. But here I added an href which invokes the doLogin action . when I click on the link I get the following error
type Status report
message /web/login/showLogin.action
description The requested resource (/web/login/showLogin.action) is not available.
Here is the snapshop of my web.xml
<?xml version="1.0" encoding="UTF-8"?> <web-app xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns="http://java.sun.com/xml/ns/javaee" xmlns:web="http://java.sun.com/xml/ns/javaee/web-app_2_5.xsd" xsi:schemaLocation="http://java.sun.com/xml/ns/javaee http://java.sun.com/xml/ns/javaee/web-app_2_5.xsd" id="WebApp_ID" version="2.5"> <display-name>web</display-name> <!-- <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> --> <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> </web-app>
and my struts.xml file code is:
<?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.devMode" value="false" />
<include file="helloWorld.xml"/> <include file="login.xml"></include>
<!-- Add packages here -->
</struts>
and the login.xml has the following code: <?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> <package name="com.thermo.asp.support.authentication" namespace="/login" extends="struts-default"> <action name="doLogin" class="com.thermo.asp.support.authentication.Login"> <result name="input">/pages/login.jsp</result> <result name="error">/pages/login.jsp</result> <result>/pages/loginSuccess.jsp</result> </action> <!-- <action name="Login_*" method="{1}" class="example.Login"> <result name="input">/example/Login.jsp</result> <result type="redirect-action">Menu</result> </action> <action name="*" class="example.ExampleSupport"> <result>/example/{1}.jsp</result> </action> --> <!-- Add actions here --> <action name="showLogin"> <result>/pages/login.jsp</result> </action> </package> </struts>
I am not able to figure out where is the problem. One more thing so for I haven't used the build.xml file. So I don't whether this is the problem or something else.
I would really appreciate any help regarding this. I really need to get it done as soon as I can otherwise I will be in trouble.
Thanks for your help in advance
|
| Answers |
| More Questions |
|
|
Post Answers
Ask Question
Facing Programming Problem?
|
|
|
|
|