Hello Vikrant,
Alternatively try submitting form through javascript function.

<%@ 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"/>
<script language="javascript">
function fnSubmit(){
        document.forms[0].action="doLogin.action";
        document.forms[0].submit();
}
</script>
</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:password name="password" label="Password"/>
        <s:submit value="Login" align="center"/>
        <input type="button" name="login" value="Login"
onclick="javascript:fnSubmit()" />
        </s:form>
</body>
</html>

Regards,
Raghuveer Vellanki

-----Original Message-----
From: Raghuveer.V [mailto:raghuve...@infotechsw.com] 
Sent: Wednesday, November 25, 2009 4:19 PM
To: 'user@struts.apache.org'
Cc: 'shimpi.vikr...@gmail.com'
Subject: RE: no Action mapped for namespace / and action name doLogin.

Hello Vikrant,

Very minor issue, I have reviewed your code and don't find any error.
Your xml configurations says you need to call default execute() in
com.tcs.infra.cmt.Login.java.

This should work on all servers.
I have tested a similar code in Tomcat and web sphere.

If you don't mention any namespace, it considers default package whose
namespace is as below in struts.xml.

<package name="sample" extends="struts-default" namespace="/">

You need to review your code either in 
1. Action mapping in struts.xml 
2. Action class implementing any specific interceptors.

In your struts.xml file change the following properties as below and test.
struts.devMode to true helps you to debug faster with enough logging
information.


struts.enable.DynamicMethodInvocation=true
struts.devMode=true

Regards,
Raghuveer Vellanki

-----Original Message-----
From: vikrant S [mailto:shimpi.vikr...@gmail.com] 
Sent: Wednesday, November 25, 2009 12:57 PM
To: user@struts.apache.org
Subject: Re: no Action mapped for namespace / and action name doLogin.


No configuration found for the specified action under struts2.0.11

Hi all, I am using jboss v5.0 and my login.jsp is

%@ 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">
                <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>
 
and my struts.xml 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"/>
    
         <package name="sample" extends="struts-default" namespace="/">
                <action name="doLogin" class="com.tcs.infra.cmt.Login">

                         <result name="input">/login.jsp</result>
                         <result name="error">/login.jsp</result>
                         <result>/loginsuccess.jsp</result>
                </action>
                </package>
</struts>

and my web.xml is like this

<?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.StrutsPrepareAndExecut
eFilter</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>


getting the following error
There is no Action mapped for namespace / and action name doLogin.
at
com.opensymphony.xwork2.DefaultActionProxy.prepare(DefaultActionProxy.java:1
77)
        at
org.apache.struts2.impl.StrutsActionProxy.prepare(StrutsActionProxy.java:61)
        at
org.apache.struts2.impl.StrutsActionProxyFactory.createActionProxy(StrutsAct
ionProxyFactory.java:39)
        at
com.opensymphony.xwork2.DefaultActionProxyFactory.createActionProxy(DefaultA
ctionProxyFactory.java:47)
        at
org.apache.struts2.dispatcher.Dispatcher.serviceAction(Dispatcher.java:458)
        at
org.apache.struts2.dispatcher.ng.ExecuteOperations.executeAction(ExecuteOper
ations.java:77)
        at
org.apache.struts2.dispatcher.ng.filter.StrutsPrepareAndExecuteFilter.doFilt
er(StrutsPrepareAndExecuteFilter.java:76)
        at
org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(Application
FilterChain.java:235)
        at
org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterCh
ain.java:206)
        at
org.jboss.web.tomcat.filters.ReplyHeaderFilter.doFilter(ReplyHeaderFilter.ja
va:96)
        at
org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(Application
FilterChain.java:235)
        at
org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterCh
ain.java:206)
        at
org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.ja
va:235)
        at
org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.ja
va:191)
        at
org.jboss.web.tomcat.security.SecurityAssociationValve.invoke(SecurityAssoci
ationValve.java:190)
        at
org.jboss.web.tomcat.security.JaccContextValve.invoke(JaccContextValve.java:
92)
        at
org.jboss.web.tomcat.security.SecurityContextEstablishmentValve.process(Secu
rityContextEstablishmentValve.java:126)
        at
org.jboss.web.tomcat.security.SecurityContextEstablishmentValve.invoke(Secur
ityContextEstablishmentValve.java:70)
        at
org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:127
)
        at
org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:102
)
        at
org.jboss.web.tomcat.service.jca.CachedConnectionValve.invoke(CachedConnecti
onValve.java:158)
        at
org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java
:109)
        at
org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:330)
        at
org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:829)
        at
org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.process(Http
11Protocol.java:601)
        at
org.apache.tomcat.util.net.JIoEndpoint$Worker.run(JIoEndpoint.java:447)
        at java.lang.Thread.run(Unknown Source)


I am not able to understand while I am getting this error . Please help me
out of this??
-- 
View this message in context:
http://old.nabble.com/no-Action-mapped-for-namespace---and-action-name-doLog
in.-tp26508228p26508528.html
Sent from the Struts - User mailing list archive at Nabble.com.




---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscr...@struts.apache.org
For additional commands, e-mail: user-h...@struts.apache.org

Reply via email to