Latest Tutorials| Questions and Answers|Ask Questions?|Site Map

Home Answers Viewqa Struts STRUTS 2 Could not find action or result

Have Programming Question? Ask it here!

sachin negi
STRUTS 2 Could not find action or result
0 Answer(s)      2 years and 6 months ago
Posted in : Struts

hiii..i am new to struts 2 framework...i developed my jsp code into sturs frame work...but its showing some warning and the "menujsp.jsp" page is not opening...its showing the following on my log:

WARNING: Could not find action or result 
There is no Action mapped for namespace [/] and action name [menujsp] associated with context path [/Basic]. - [unknown location] 
at com.opensymphony.xwork2.DefaultActionProxy.prepare( 
at org.apache.struts2.impl.StrutsActionProxy.prepare( 
at org.apache.struts2.impl.StrutsActionProxyFactory.createActionProxy( 
at com.opensymphony.xwork2.DefaultActionProxyFactory.createActionProxy( 
at org.apache.struts2.dispatcher.Dispatcher.serviceAction( 
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) 

Following are the contents of my application:

package pkg; 
import java.sql.Connection; 
import java.sql.DriverManager; 

public class ConnectionProvider 
public static Connection getConnection(){ 
Connection con=null; 
catch(Exception e){ 
return con; 

package pkg; 

import java.sql.Connection; 
import java.sql.PreparedStatement; 
import java.sql.ResultSet; 
import java.util.*; 

public class DAO 
public List<MenuList> fetch(){ 
Connection con=ConnectionProvider.getConnection(); 
PreparedStatement stmt=con.prepareStatement("select * from application where application_id in (select distinct application_id from applicationmenu order by application_id)"); 
ResultSet rs=stmt.executeQuery(); 
ResultSet rs1=null; 
MenuList menulist; 
List<MenuList> list=new ArrayList<MenuList>(); 
menulist=new MenuList(); 
PreparedStatement stmt1=con.prepareStatement("select * from menu where menu_id in (select menu_id from applicationmenu where application_id='"+rs.getString(1)+"')"); 

return list;    
catch(Exception e) 
return null; 


package pkg; 

public class MenuList { 
String menuId; 
String menuTitle; 
String submenuTitle; 
public MenuList() 
public MenuList(String menuId,String menuTitle,String submenuTitle) 
public String getMenuId() 
return menuId; 
public String getmenuTitle() 
return menuTitle; 
public String submenuTitle() 
return submenuTitle; 
public void setmenuId(String menuId) 
this.menuId = menuId; 
public void setmenuTitle(String menuTitle) 
this.menuTitle = menuTitle; 
public void setsubmenuTitle(String submenuTitle) 
this.submenuTitle = submenuTitle; 

package pkg; 
import java.util.*; 
import com.opensymphony.xwork2.ActionSupport; 
public class MenuListAction extends ActionSupport 
private MenuList menulist; 
private List<MenuList> menulistlist; 
DAO dao=new DAO(); 
public String execute() 
return "success"; 
public MenuList getMenulist() 
return menulist; 
public void setMenulist(MenuList menulist) 
this.menulist = menulist; 
public List<MenuList> getMenulistlist() 
return menulistlist; 
public void setMenulistlist(List<MenuList> menulistlist) 
this.menulistlist = menulistlist; 


web.xml :

<?xml version="1.0" encoding="UTF-8"?> 
<web-app version="2.5" 


struts.xml :

<?xml version="1.0" encoding="UTF-8" ?> 
<!DOCTYPE struts PUBLIC "-//Apache Software Foundation//DTD Struts Configuration 
2.0//EN" ""> 

<constant name="struts.devMode" value="true"></constant> 

<package name="Basic" extends="struts-default"> 
<action name="fetch" class="pkg.MenuListAction" method="execute"> 

<result name="success" >/menujsp.jsp</result> 


index.jsp :

<%@ page language="java" contentType="text/html; charset=ISO-8859-1" 
<%@taglib uri="/struts-tags" prefix="s" %> 
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" ""> 
<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1"> 
<head><title>DYNAMIC DROPDOWN MENU</title></head> 

<a href="menujsp.jsp">Home Page</a> 


menujsp.jsp :

<%@ taglib prefix="s" uri="/struts-tags" %> 
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" ""> 

background-image:ur(C:\indian-flag-12.gif) no-repeat ; 
<script type="text/javascript"> 
function showmenu(elmnt) 
function hidemenu(elmnt) 

<table width="100%"> 
<tr bgcolor="#FG8080"> 
<s:iterator value="menulistlist" var="menulist"> 
<td onmouseover="showmenu(<s:property value="#parent.menuId"/>)" onmouseout="hidemenu(<s:property value="#parent.menuId"/>)"> 
<a href="/default.asp"><s:property value="#parent.menuTitle"/></a><br /> 
<table class="menu" id="<s:property value="#parent.menuId"/>" width="120"> 
<s:iterator value="menulistlist" var="menulist"> 
<tr><td class="menu" id="<s:property value="#parent.menuId"/>"><a href="/html/default.asp"><s:property value="submenuTitle"/></a></td></tr> 




plzz help me out...i might have problem in my struts.xml...its not mapping with the action resource my menujsp.jsp code must also be incorrect but thats another issue...first i need to display this jsp whic isn't happening... regards Sachin

View Answers

Related Tutorials/Questions & Answers:
STRUTS 2 Could not find action or result
STRUTS 2 Could not find action or result  hiii..i am new to struts 2... on my log: WARNING: Could not find action or result There is no Action...;package name="Basic" extends="struts-default"> <action name="fetch" class
Struts 2 action-validation.xml not loading
Struts 2 action-validation.xml not loading  Hi All, I am getting...-validation.xml is package/src/class name/action-validation.xml Could you please let me... error SERVER : Caught exception while loading file package/action-validation.xml
Struts 2 Action Tag
Struts 2 Action Tag "action" Tag in Struts 2 is used by developer to call... action name. Struts 2 Action Tag is one of the Data Tags, which are used.... Following example will further explain the complete use of Struts 2 Action
jsp to struts 2 action conversion problem - Struts
jsp to struts 2 action conversion problem  i have one jsp page that includes 3 other jsp pages(using RequestDispactcher).how to convert that jsp page to a struts2 action?among that one jsp page is wrritten using jpivot,wct tags
Struts 2 Redirect Action
Struts 2 Redirect Action       In this section, you will get familiar with struts 2 Redirect action and learn to use it in the struts 2 application. Redirect After Post: This post
Action in Struts 2 Framework
, and select the view result page that should send back to the user action class... action provides the processing logic for a specific URL with which it is linked. Actions are mostly associated with a HTTP request of User. The action class
how to forward select query result to jsp page using struts action class
how to forward select query result to jsp page using struts action class  how to forward select query result to jsp page using struts action class
no action mapped for action - Struts
no action mapped for action  Hi, I am new to struts. I followed...: There is no Action mapped for action name HelloWorld
could not find a getter for id in contact class
could not find a getter for id in contact class   could not find a getter for id in contact class
Struts Action Chaining
Struts Action Chaining  Struts Action Chaining
Struts Action Classes
Struts Action Classes  1) Is necessary to create an ActionForm to LookupDispatchAction. If not the program will not executed. 2) What is the beauty of Mapping Dispatch Action
action tag - Struts
action tag  Is possible to add parameters to a struts 2 action tag? And how can I get them in an Action Class. I mean: xx.jsp Thank you
Struts 2 Interceptors
Struts 2 Interceptors Struts 2 framework relies upon Interceptors to do most... part of Struts 2 default stack and are executed in a specific order... tutorials about the Struts 2 framework
Struts 2
Struts 2  we can extend DispatchAction class to implement a common session validation in struts 1.x. how to do the same in the struts2
Struts 2
Struts 2  I am getting the following error.pls help me out. The Struts dispatcher cannot be found. This is usually caused by using Struts tags without the associated filter. Struts tags are only usable when the request has
Struts 2 RequiredFieldValidator - Struts
What is Struts 2 RequiredFieldValidator? Need an Example or Code  What is Struts 2 RequiredFieldValidator? Need an Example or Code on Field Validation in Struts 2.  Please follow the following instruction:1. index.jsp
Struts dispatch action - Struts
Struts dispatch action  i am using dispatch action. i send the parameter="addUserAction" as querystring.ex: at this time it working fine. but now my problem is i want to send another value as querystring for example
Action Configuration - Struts
Action Configuration  I need a code for struts action configuration in XML
servlet action not available - Struts
. Struts Blank Application action org.apache.struts.action.ActionServlet config /WEB-INF/struts-config.xml 2 action *.do...servlet action not available  hi i am new to struts and i am
struts 2 testing
struts 2 testing  can i get an example for struts 2 action class unit test
Struts 2
Struts 2   I am just new to struts 2 and need to do the task. I have a requirement like this : when i click on link like Customer , this will display all the customers , address from a database table using jdbc and the screen
Struts 2 - Validation - Struts
Struts 2 - Validation annotations  digging for a simple struts 2 validation annotations example
could not find the main class programm will exit - error
could not find the main class programm will exit - error  when i tried to run the below mentioned programmed it gives a error states - could not find main class programm will exit. class Car { String name: String Color
Struts Action Class
Struts Action Class  What happens if we do not write execute() in Action class
Where to learn Struts 2?
Where to learn Struts 2?  Hi, I am beginner in Struts and trying to find good tutorial to learn Struts 2 framework. My project is in Struts 2 and soon I have to work on the project. Let's know where to learn the Struts 2
struts 2 tabbedpanel - Struts
struts 2 tabbedpanel  Hi Friend do I change the background color of a tab? bye bye
Login Action Class - Struts
Login Action Class  Hi Any one can you please give me example of Struts How Login Action Class Communicate with i-batis
Action classes in struts
Action classes in struts  how many type action classes are there in struts   Hi Friend, There are 8 types of Action classes: 1.ForwardAction class 2.DispatchAction class 3.IncludeAction class 4.LookUpDispatchAction
Redirect Action Result Example
Redirect Action Result Example The Result uses the ActionMapper of the ActionMapperFactory for redirecting the URL to the specified action. To redirect...;action name="homePage"> <result >/jsp/home.jsp</result>
How to eliminate error," Could not find the main class: filecopy.FileCopy. Program will exit." ?
How to eliminate error," Could not find the main class: filecopy.FileCopy....) at java.lang.ClassLoader.loadClass( Could not find the main... Result: 1 BUILD SUCCESSFUL (total time: 0 seconds
Chain Action Result Example
in an application by applying Chain Result to a action. A Chain Result is an result type...; extends="struts-default" namespace="/secure"> <action...Chain Action Example Struts2.2.1 provides the feature to chain many actions
Struts 2 - Beganner
Struts 2 - Beganner  Hi ! I am new to Struts2 and I need clarification over Difference between Action Proxy and Action Mapper in struts2 and When both perform their activity?????? Many Thanks Venkateshlu
Time Picker in struts 2 - Struts
Time Picker in struts 2  How to create Time Picker in Struts 2 ? ...;</ul>2. struts.xml (Add the following code)<action name="...;head> <title>Struts 2 Time Picker Example!</title>
Struts 2 problem - Struts
Struts 2 problem  Hello I have a very strange problem. I have an application that we developed in JAVA and the application works ok in Windows... seemed to worked fine, until the user reported to us a problem. After doing
Introduction to Struts 2 Framework
. Feature Struts 1 Struts 2 Action classes Struts1... with an execute signature can be used as an Struts 2 Action object... ActionForward is class in Struts 1. In Struts 2 action returns
Struts 2 Actions
application frameworks. Struts 2 Action are the important concept in Struts 2... request. About Struts Action Interface In Struts 2 all actions may implement... the Action interface and simple POJO classes can be used as actionStruts 2
how to sort the result of this 2 class program in java.....????
how to sort the result of this 2 class program in java.....????  package setget1_method; import java.util.Scanner; public class Main { { { Scanner input = new Scanner(; LBook[] book = new LBook[5]; String
Struts 2 Training
Struts 2 Training       The Struts 2 Training for developing enterprise applications with Struts 2 framework. Course Code: STRUS-2 Duration: 5.0 day(s) Apply for Struts 2 Training Lectures
Error 500: WSWS3142E: Error: Could not find Web services engine. - WebSevices
Error Could not find Web services engine   Hi...: faultNode: faultDetail: {}:return code: 500 Error 500: WSWS3142E: Error: Could not find Web services engine. {
struts 2 problem with netbeans - Struts
struts 2 problem with netbeans  i made 1 application in struts2 with netbeans but got one errror like There is no Action mapped for namespace / and action name login. The requested resource (There is no Action mapped
session maintain in struts 2
session maintain in struts 2  hi i am new to Struts 2..... in Action class i wrote **HttpSession session = request.getSession(); session.setAttribute("name", name1);** but in jsp class String session_name=(String
Error 500: WSWS3142E: Error: Could not find Web services engine. - WebSevices
Error 500 WSWS3142E Error Could not find Web services engine  Hi all, I am getting the following error.Error 500: WSWS3142E: Error: Could not find Web services engine. Please Help. Thanks in Advance
getting result in table dynamically - Struts
getting result in table dynamically  How do i get result in tabular format dynamically using our own tags
Struts 2 Integration with Struts 1
Struts 2 Integration with Struts 1  I want to integrate struts 2 with struts 1 existing application. Can you please help on how to go about this. I am not finding any good source to integrate struts 2 with struts 1 framework
action Servlet - Struts
action Servlet  What is the difference between ActionServlet ans normal servlet? And why actionServlet is required
Struts 2 issue
Struts 2 issue  hi, I have one jsp page and having one hidden field methodName and when we submit request we get value in action class and again i... to same action now problem is when we submit request first time e.g value
How to Use Struts 2 token tag - Struts
How to Use Struts 2 token tag  Hi , I want to stop re-submiiting... on my jsp but not able to find what other things i need to write on my action page, or do i need to map anything on my struts.xml file ? I am using struts 2
DTO & Action class - Struts
DTO & Action class  Hi I am really new to struts2. I just wanted to know that if I have a DTO and an action class, how do I put the form data into the DTO? Can someone please explain with a simple example
regarding struts 2
regarding struts 2   is it not possible to get values from into our application in struts 2
Struts 2 online tutorial
Struts 2 online tutorial  Where to learn struts 2 online tutorial? Is there any good tutorials on for learning struts 2 online tutorial?   Yes, We have many tutorials for learning Struts 2 online through