Win a copy of Kotlin in Action this week in the Kotlin forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic

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

kalaiselvi Bhalerao
Posts: 9
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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(
at org.apache.struts2.impl.StrutsActionProxyFactory.createActionProxy(
at org.apache.struts2.dispatcher.Dispatcher.serviceAction(
at org.apache.struts2.dispatcher.FilterDispatcher.doFilter(
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(
at org.apache.catalina.core.ApplicationFilterChain.doFilter(
at org.apache.catalina.core.StandardWrapperValve.invoke(
at org.apache.catalina.core.StandardContextValve.invoke(
at org.apache.catalina.core.StandardHostValve.invoke(
at org.apache.catalina.valves.ErrorReportValve.invoke(
at org.apache.catalina.core.StandardEngineValve.invoke(
at org.apache.catalina.connector.CoyoteAdapter.service(
at org.apache.coyote.http11.Http11Processor.process(
at org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.process(
at 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="" xmlns="" xmlns:web="" xsi:schemaLocation="" 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
Posts: 188
Hibernate Java
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
hi there,

i think you are missing "namespace"

in struts.xml
kalaiselvi Bhalerao
Posts: 9
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
i did try adding namespace to struts.xml that also gave the same error.
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!