Struts2 Action mapping problem

Discussion in 'Java' started by newbieIn, Jul 20, 2012.

  1. newbieIn

    newbieIn

    Joined:
    Jul 20, 2012
    Messages:
    2
    Hi,

    I am new to struts2 and to this forum.

    I have written an action class as follows

    public class StartAction extends ActionSupport implements SessionAware{
    private Map<String, Object> session;
    public String execute() {
    return LOGIN;
    }
    @Override
    public void setSession(Map<String, Object> session) {
    this.session = session;
    }

    public Map<String, Object> getSession(){
    return session;
    }
    }

    And have placed struts entries as
    <action name="Start" class="common.StartAction"
    method="execute">
    <result name="login" >/finadvisor/jspPages/Login.jsp</result>
    </action>

    And jsp calling Start Action is as
    <body>
    <h1>Hello World!</h1>
    <s:form action="Start" method="POST">
    <s:submit value="Start" align="center"/>
    </s:form>
    </body>

    Not sure where I am going wrong, I am getting below useless ST
    Struts Problem Report

    Struts has detected an unhandled exception:

    Messages:
    There is no Action mapped for namespace / and action name .
    Stacktraces

    There is no Action mapped for namespace / and action name . - [unknown location]
    com.opensymphony.xwork2.DefaultActionProxy.prepare(DefaultActionProxy.java:178)
    org.apache.struts2.impl.StrutsActionProxy.prepare(StrutsActionProxy.java:61)
    org.apache.struts2.impl.StrutsActionProxyFactory.createActionProxy(StrutsActionProxyFactory.java:39)
    com.opensymphony.xwork2.DefaultActionProxyFactory.createActionProxy(DefaultActionProxyFactory.java:47)
    org.apache.struts2.dispatcher.Dispatcher.serviceAction(Dispatcher.java:478)
    org.apache.struts2.dispatcher.ng.ExecuteOperations.executeAction(ExecuteOperations.java:77)
    org.apache.struts2.dispatcher.ng.filter.StrutsPrepareAndExecuteFilter.doFilter(StrutsPrepareAndExecuteFilter.java:91)
    org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:230)
    org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:198)
    org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:288)
    org.apache.catalina.core.StandardContextValve.invokeInternal(StandardContextValve.java:271)
    org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:202)
    org.apache.catalina.core.StandardPipeline.doInvoke(StandardPipeline.java:632)
    org.apache.catalina.core.StandardPipeline.doInvoke(StandardPipeline.java:577)
    com.sun.enterprise.web.WebPipeline.invoke(WebPipeline.java:94)
    org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:206)
    org.apache.catalina.core.StandardPipeline.doInvoke(StandardPipeline.java:632)
    org.apache.catalina.core.StandardPipeline.doInvoke(StandardPipeline.java:577)
    org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:571)
    org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:1080)
    org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:150)
    org.apache.catalina.core.StandardPipeline.doInvoke(StandardPipeline.java:632)
    org.apache.catalina.core.StandardPipeline.doInvoke(StandardPipeline.java:577)
    org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:571)
    org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:1080)
    org.apache.coyote.tomcat5.CoyoteAdapter.service(CoyoteAdapter.java:272)
    com.sun.enterprise.web.connector.grizzly.DefaultProcessorTask.invokeAdapter(DefaultProcessorTask.java:637)
    com.sun.enterprise.web.connector.grizzly.DefaultProcessorTask.doProcess(DefaultProcessorTask.java:568)
    com.sun.enterprise.web.connector.grizzly.DefaultProcessorTask.process(DefaultProcessorTask.java:813)
    com.sun.enterprise.web.connector.grizzly.DefaultReadTask.executeProcessorTask(DefaultReadTask.java:341)
    com.sun.enterprise.web.connector.grizzly.DefaultReadTask.doTask(DefaultReadTask.java:263)
    com.sun.enterprise.web.connector.grizzly.DefaultReadTask.doTask(DefaultReadTask.java:214)
    com.sun.enterprise.web.portunif.PortUnificationPipeline$PUTask.doTask(PortUnificationPipeline.java:380)
    com.sun.enterprise.web.connector.grizzly.TaskBase.run(TaskBase.java:265)
    com.sun.enterprise.web.connector.grizzly.ssl.SSLWorkerThread.run(SSLWorkerThread.java:106)

    You are seeing this page because development mode is enabled. Development mode, or devMode, enables extra debugging behaviors and reports to assist developers. To disable this mode, set:

    struts.devMode=false
    in your WEB-INF/classes/struts.properties file.

    Please help!!!
    newbieIn, Jul 20, 2012
    #1
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. runescience

    Struts mapping action to action???

    runescience, Feb 6, 2006, in forum: Java
    Replies:
    3
    Views:
    1,808
    runescience
    Feb 7, 2006
  2. OTB
    Replies:
    0
    Views:
    659
  3. Elhanan
    Replies:
    0
    Views:
    549
    Elhanan
    Dec 24, 2006
  4. theog
    Replies:
    0
    Views:
    911
    theog
    Jul 7, 2008
  5. timjowers

    RAD7 and Struts2 404 error

    timjowers, Oct 16, 2008, in forum: Java
    Replies:
    0
    Views:
    941
    timjowers
    Oct 16, 2008
Loading...

Share This Page