This week's giveaway is in the Android forum.
We're giving away four copies of Android Security Essentials Live Lessons and have Godfrey Nolan on-line!
See this thread for details.
The moose likes Struts and the fly likes No configuration found for the specified action Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Android Security Essentials Live Lessons this week in the Android forum!
JavaRanch » Java Forums » Frameworks » Struts
Bookmark "No configuration found for the specified action" Watch "No configuration found for the specified action" New topic
Author

No configuration found for the specified action

R Pa
Greenhorn

Joined: Aug 27, 2008
Posts: 12
Hi,

I get the following message "No configuration found for the specified action : 'doLogin' in namespace: '/actions'" when I try to submit login.jsp page containing username and password as input fields and submit button.

login.jsp:
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<%@page language="java" contentType="text/html; charset=ISO-8859-1"
pageEncoding="ISO-8859-1"%>
<%@ taglib prefix="s" uri="/struts-tags" %>

<html>
<head>
<title>test</title>
<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1">
<meta name="GENERATOR" content="Rational Application Developer">
</head>
<body>
<s:form action="doLogin">
<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 assword 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="true" />

<!-- Add packages here -->
<package name="actions" namespace="/" extends="struts-default">

<action name="doLogin" class="actions.Login">
<result name="input">/actions/login.jsp</result>
<result name="error">/actions/login.jsp</result>
<result>/actions/loginsuccess.jsp</result>
</action>
</package>

</struts>

Also the struts.xml files is directly under WEB-INF/classes folder.
yash wardhan
Ranch Hand

Joined: Jan 22, 2008
Posts: 46
try
<s:form action="doLogin.action">

may be this helps.
R Pa
Greenhorn

Joined: Aug 27, 2008
Posts: 12
I get the following message:
No configuration found for the specified action: 'doLogin.action' in namespace: '/actions'.
for
<s:form action="doLogin.action">
Sudarshan Chakrabarty
Ranch Hand

Joined: Apr 10, 2008
Posts: 38

<action name="doLogin" class="actions.Login">
<result name="input">/actions/login.jsp</result>
<result name="error">/actions/login.jsp</result>
<result>/actions/loginsuccess.jsp</result>
</action>


Is your "login.jsp" and "loginsuccess.jsp" located inside a folder named "actions"?
R Pa
Greenhorn

Joined: Aug 27, 2008
Posts: 12
yes.Both the jsps are in the actions folder
Sudarshan Chakrabarty
Ranch Hand

Joined: Apr 10, 2008
Posts: 38

<!-- Add packages here -->
<package name="actions" namespace="/" extends="struts-default">
..
</package>


Try removing the " namespace="/" " attribute
i.e.
<package name="actions" extends="struts-default">
..
</package>
R Pa
Greenhorn

Joined: Aug 27, 2008
Posts: 12
still doesnt work...
Sudarshan Chakrabarty
Ranch Hand

Joined: Apr 10, 2008
Posts: 38
Well, it's working for me.
Which web server are you using? Try removing your explorer as well as server cache and see. It should work.
R Pa
Greenhorn

Joined: Aug 27, 2008
Posts: 12
Now I'm not getting any error/warning messages in the console but still the action class is not getting invoked..and I get 404 error.
I'm using websphere...
Sudarshan Chakrabarty
Ranch Hand

Joined: Apr 10, 2008
Posts: 38

Now I'm not getting any error/warning messages in the console but still the action class is not getting invoked..and I get 404 error.

Well, your server is unable to find your jsp's.
It seems your jsp pages are not in the right folder.
Can you tell us the folder structure ?
R Pa
Greenhorn

Joined: Aug 27, 2008
Posts: 12
This is the folder structure:

test1/src-contains java source files.
test1/WebContent/actions-contains jsps
test1/WEB-INF/classes-contains the struts-xml
Sudarshan Chakrabarty
Ranch Hand

Joined: Apr 10, 2008
Posts: 38
Your folder structure looks ok. Are you able to get the initial page "login.jsp" atleast ?
R Pa
Greenhorn

Joined: Aug 27, 2008
Posts: 12
i'm able to get the initial login page.
only after I click on the submit button all problems happen....
Sudarshan Chakrabarty
Ranch Hand

Joined: Apr 10, 2008
Posts: 38
Which version of Struts are you using?
R Pa
Greenhorn

Joined: Aug 27, 2008
Posts: 12
struts-2.0.11.2
Dhirendra Rajput
Greenhorn

Joined: Nov 04, 2008
Posts: 1
Try by puttiing your struts.xml in src folder also...
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: No configuration found for the specified action
 
Similar Threads
Struts 2.0.9 - Problem in following a hyper link
WARNING: Could not find action or result
Struts 2 - wrong method executed
/struts2tutorial/struts2tutorial/roseindia/showLogin.action) is not available.
New to Struts 2 framework