wood burning stoves*
The moose likes Struts and the fly likes struts 2 error ---- Could not find action or result Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Frameworks » Struts
Bookmark "struts 2 error ---- Could not find action or result" Watch "struts 2 error ---- Could not find action or result" New topic

struts 2 error ---- Could not find action or result

kalaiselvi Bhalerao

Joined: Aug 19, 2011
Posts: 9
Hi everybody

I am getting the error message as below

SEVERE: Could not find action or result
There is no Action mapped for action name display. - [unknown location]
at com.opensymphony.xwork2.DefaultActionProxy.prepare(DefaultActionProxy.java:186)
at org.apache.struts2.impl.StrutsActionProxyFactory.createActionProxy(StrutsActionProxyFactory.java:41)
at org.apache.struts2.dispatcher.Dispatcher.serviceAction(Dispatcher.java:497)
at org.apache.struts2.dispatcher.FilterDispatcher.doFilter(FilterDispatcher.java:421)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:235)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:233)
at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:191)
at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:127)
at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:102)
at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:109)
at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:291)
at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:859)
at org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.process(Http11Protocol.java:602)
at org.apache.tomcat.util.net.JIoEndpoint$Worker.run(JIoEndpoint.java:489)
at java.lang.Thread.run(Unknown Source)

I am using Eclipse ID to create a simple Struts 2 application


"-//Apache Software Foundation//DTD Struts Configuration 2.0//EN"

<package name="default" extends="struts-default">
<action name="display" class="example1.action.DisplayName">

<result name="success">/example1/success.jsp</result>
<result name="input">/example1/UserInput.jsp</result>

Action class

package example1.action;

import com.opensymphony.xwork2.ActionSupport;

public class DisplayName extends ActionSupport {
private String message;

private String userName;

public DisplayName() {
System.out.println("DisplayName constructor");

public String execute() {
setMessage("Hello " + getUserName());
return SUCCESS;

public String getMessage() {
return message;

public void setMessage(String message) {
this.message = message;

public String getUserName() {
return userName;

public void setUserName(String userName) {
this.userName = userName;


Input page

<%@ page language="java" contentType="text/html; charset=ISO-8859-1"
<%@taglib uri="/struts-tags" prefix="s" %>
<title>User Input</title>
<s:head />
User Input Form
<s:form action="display" >
<s:textfield name="userName" label="User Name" />
<s:submit />

<?xml version="1.0" encoding="UTF-8"?>
<web-app xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns="http://java.sun.com/xml/ns/javaee" xmlns:web="http://java.sun.com/xml/ns/javaee/web-app_2_5.xsd" xsi:schemaLocation="http://java.sun.com/xml/ns/javaee http://java.sun.com/xml/ns/javaee/web-app_2_5.xsd" id="WebApp_ID" version="2.5">




pl help me to resolve the error.
I assume there is a silly mistake, but i am not able to trace the error.
i guess the tomcat is not able to read struts.xml
debraj mallick
Ranch Hand

Joined: Mar 08, 2011
Posts: 188

hi there,

i think you are missing "namespace"

in struts.xml
kalaiselvi Bhalerao

Joined: Aug 19, 2011
Posts: 9
i did try adding namespace to struts.xml that also gave the same error.
With a little knowledge, a cast iron skillet is non-stick and lasts a lifetime.
subject: struts 2 error ---- Could not find action or result
Similar Threads
unknown error while running Struts2 application
problem in Struts2 while running an application
Struts 2 problem-actions cant find the result. WARNING: Could not find action or result
The requested resource () is not available.
Is my application running or is it just stuck??