Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > Java > Struts2 Action mapping problem

Reply
Thread Tools

Struts2 Action mapping problem

 
 
newbieIn newbieIn is offline
Junior Member
Join Date: Jul 2012
Posts: 2
 
      07-20-2012
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:17
org.apache.struts2.impl.StrutsActionProxy.prepare( StrutsActionProxy.java:61)
org.apache.struts2.impl.StrutsActionProxyFactory.c reateActionProxy(StrutsActionProxyFactory.java:39)
com.opensymphony.xwork2.DefaultActionProxyFactory. createActionProxy(DefaultActionProxyFactory.java:4 7)
org.apache.struts2.dispatcher.Dispatcher.serviceAc tion(Dispatcher.java:47
org.apache.struts2.dispatcher.ng.ExecuteOperations .executeAction(ExecuteOperations.java:77)
org.apache.struts2.dispatcher.ng.filter.StrutsPrep areAndExecuteFilter.doFilter(StrutsPrepareAndExecu teFilter.java:91)
org.apache.catalina.core.ApplicationFilterChain.in ternalDoFilter(ApplicationFilterChain.java:230)
org.apache.catalina.core.ApplicationFilterChain.do Filter(ApplicationFilterChain.java:19
org.apache.catalina.core.StandardWrapperValve.invo ke(StandardWrapperValve.java:28
org.apache.catalina.core.StandardContextValve.invo keInternal(StandardContextValve.java:271)
org.apache.catalina.core.StandardContextValve.invo ke(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(WebPipel ine.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(S tandardPipeline.java:571)
org.apache.catalina.core.ContainerBase.invoke(Cont ainerBase.java:1080)
org.apache.catalina.core.StandardEngineValve.invok e(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(S tandardPipeline.java:571)
org.apache.catalina.core.ContainerBase.invoke(Cont ainerBase.java:1080)
org.apache.coyote.tomcat5.CoyoteAdapter.service(Co yoteAdapter.java:272)
com.sun.enterprise.web.connector.grizzly.DefaultPr ocessorTask.invokeAdapter(DefaultProcessorTask.jav a:637)
com.sun.enterprise.web.connector.grizzly.DefaultPr ocessorTask.doProcess(DefaultProcessorTask.java:56
com.sun.enterprise.web.connector.grizzly.DefaultPr ocessorTask.process(DefaultProcessorTask.java:813)
com.sun.enterprise.web.connector.grizzly.DefaultRe adTask.executeProcessorTask(DefaultReadTask.java:3 41)
com.sun.enterprise.web.connector.grizzly.DefaultRe adTask.doTask(DefaultReadTask.java:263)
com.sun.enterprise.web.connector.grizzly.DefaultRe adTask.doTask(DefaultReadTask.java:214)
com.sun.enterprise.web.portunif.PortUnificationPip eline$PUTask.doTask(PortUnificationPipeline.java:3 80)
com.sun.enterprise.web.connector.grizzly.TaskBase. run(TaskBase.java:265)
com.sun.enterprise.web.connector.grizzly.ssl.SSLWo rkerThread.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!!!
 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
RAD7 and Struts2 404 error timjowers Java 0 10-16-2008 10:04 PM
Struts2 and Freemarker : How do you pass a variable into a struts 2action from a freemarker template theog Java 0 07-07-2008 02:02 AM
struts2 + commons validator + JSF? Elhanan Java 0 12-24-2006 06:54 AM
[struts2] Taglib and freemarker -> insert bodyContent OTB Java 0 12-15-2006 01:43 PM
Struts mapping action to action??? runescience Java 3 02-07-2006 04:07 PM



Advertisments