I get the following message "No configuration found for the specified action:
'doLogin.action' in namespace: ''. Form action defaulting to 'action'
attribute's literal value.'" when I try to submit login.jsp page containing
username and password as input fields and submit button.
login.jsp:
<%@ taglib prefix="s" uri="/struts-tags" %>
<html>
<head>
<title>Struts 2 Login Application</title>
<link href="<s:url value="/css/main.css"/>" rel="stylesheet"
type="text/css"/>
</head>
<body>
<s:form action="doLogin.action" >
<tr>
<td colspan="2">Login</td>
</tr>
<tr>
<td colspan="2">
<s:actionerror />
<s:fielderror />
</td>
</tr>
<s:textfield name="username" label="Login name"/>
<s:password name="password" label="Password"/>
<s:submit value="Login" align="center"/>
</s:form>
</body>
</html>
struts.xml:-
<?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"/>
<package name="action" extends="struts-default" >
<action name="doLogin.action"
class="com.tcs.infra.cmt.Login_dummy">
<result name="input">/login.jsp</result>
<result name="error">/login.jsp</result>
<result>/loginsuccess.jsp</result>
</action>
</package>
</struts>
web.xml :-
<?xml version="1.0" encoding="UTF-8"?>
<web-app
id="WebApp_9" version="2.4"
xmlns="http://java.sun.com/xml/ns/j2ee"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://java.sun.com/xml/ns/j2ee
http://java.sun.com/xml/ns/j2ee/web-app_2_4.xsd">
<display-name>Sample Struts 2</display-name>
<filter>
<filter-name>struts2</filter-name>
<filter-class>org.apache.struts2.dispatcher.ng.filter.StrutsPrepareAndExecuteFilter</filter-class>
</filter>
<filter-mapping>
<filter-name>struts2</filter-name>
<url-pattern>/*</url-pattern>
</filter-mapping>
<welcome-file-list>
<welcome-file>login.jsp</welcome-file>
</welcome-file-list>
</web-app>
Login_dummy.java
package com.tcs.infra.cmt;
import com.opensymphony.xwork2.ActionSupport;
public class Login_dummy extends ActionSupport {
private String username;
private String password;
public String execute()
{
return SUCCESS;
}
public String getUsername() {
return username;
}
public void setUsername(String username) {
this.username = username;
}
public String getPassword() {
return password;
}
public void setPassword(String password) {
this.password = password;
}
}
I have added all the required jars.Please help me !!
--
View this message in context:
http://old.nabble.com/No-configuration-found-for-the-specified-action-tp26508973p26508973.html
Sent from the Struts - User mailing list archive at Nabble.com.
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]