This week's book giveaway is in the Jobs Discussion forum.
We're giving away four copies of Java Interview Guide and have Anthony DePalma on-line!
See this thread for details.
The moose likes Struts and the fly likes  The requested resource (There is no Action mapped for namespace / and action name admin-login.) Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login

Win a copy of Java Interview Guide this week in the Jobs Discussion forum!
JavaRanch » Java Forums » Frameworks » Struts
Bookmark " The requested resource (There is no Action mapped for namespace / and action name admin-login.)" Watch " The requested resource (There is no Action mapped for namespace / and action name admin-login.)" New topic

The requested resource (There is no Action mapped for namespace / and action name admin-login.)

suraj savaratkar
Ranch Hand

Joined: May 17, 2010
Posts: 96

I making an struts2 application which having some exception i not getting what is the problem please gave me hing which i can correct and run the application

I suffering following error

WARNING: Could not find action or result
There is no Action mapped for namespace / and action name admin-login. - [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.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.Http11BaseProtocol$Http11ConnectionHandler.processConnection(
at org.apache.tomcat.util.threads.ThreadPool$
at Source)


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


<constant name="struts.enable.DynamicMethodInvocation" value="false" />
<constant name="struts.ognl.allowStaticMethodAccess" value="true" />
<constant name="struts.custom.i18n.resources" value="ApplicationResources" />
<constant name="struts.ui.theme" value="simple" />
<constant name="struts.devMode" value="true" />

<package name="default" extends="struts-default">
<result-type name="tiles" class="org.apache.struts2.views.tiles.TilesResult"/>

<action name="welcomeLink">
<result type="tiles">baseLayout</result>

<action name="admin-login" class="com.suraj.AdminLoginAction" method="admin">
<result name="admin" type="tiles">admin.tiles</result>

<action name="contactUs" class="com.suraj.AdminLoginAction" method="getContactUs">
<result name="contactUs" type="tiles">contactUs.tiles</result>

<action name="aboutUs" class="com.suraj.AdminLoginAction" method="getAboutUs">
<result name="aboutUs" type="tiles">aboutUs.tiles</result>


header.jsp inside home_screen_pages folder

<%@page import=""%>
<%@page import="freemarker.ext.servlet.HttpSessionHashModel"%>
<%@ page contentType="text/html; charset=UTF-8"%>
<%@ taglib prefix="s" uri="/struts-tags"%>

<%@page import="javax.servlet.http.*"%>

<link href="css_files/search_button.css" rel="stylesheet"
type="text/css" />
<style type="text/css">
body {
font-size: .90em;
font-family: "Helvetica Neue", "Lucida Grande", "Segoe UI", Arial,
Helvetica, Verdana, sans-serif;
margin: 2px;
padding: 2px;
height: 780px;
<table height="100%" width="100%">
<td align="left" nowrap="nowrap"><img alt="Book My Movie"
src="images/mlogo_1.jpg" height="100" width="100"></td>
<td align="left" nowrap="nowrap">
<div align="left" id="moviesname">Book My Movie</div>

<td align="right" nowrap="nowrap" colspan="5">
<div align="right">
<s:form id="seach_id">
<div align="right">
<input id="submitbutton" type="submit" value="Search" />
<div align="left">
<s:textfield id="searchtextfield" name="search" size="25">
</div> <%
session = request.getSession(false);

<div align="right" id="aboutus_contactus_login_logout">
<table height="" width="30%" align="right" border="0" id="all">
<td><s:form action="contactUs.actoin">
<s:submit id="contactus" value="Contact Us"></s:submit>
<td><s:form action="aboutUs.action">
<s:submit id="aboutus" value="About Us"></s:submit>
%> <s:a href="admin-login.action">
<input type="button" id="contactus" value="Login"
title="Login"> </s:a>
%> <s:a href="admin-login.action">
<input type="button" id="contactus" value="Logout"
title="Login"> </s:a>
</div> <%
catch(NullPointerException e)


I try to link the action with struts action but i couldn't found please help out me .

I attached my eclipse project layout with image file as a reference.



suraj savaratkar
Ranch Hand

Joined: May 17, 2010
Posts: 96

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

<!DOCTYPE tiles-definitions PUBLIC
"-//Apache Software Foundation//DTD Tiles Configuration 2.0//EN"


<definition name="baseLayout" template="/first_base_layout.jsp">
<put-attribute name="title" value="Welcome to Book My Movie" />
<put-attribute name="header" value="/home_screen_pages/header.jsp" />
<put-attribute name="slide" value="/home_screen_pages/movie_slide.jsp" />
<put-attribute name="area_time" value="/home_screen_pages/area_time.jsp" />
<put-attribute name="movie_list" value="/home_screen_pages/movie_list.jsp" />
<put-attribute name="news" value="/home_screen_pages/news.jsp" />
<put-attribute name="footer" value="/home_screen_pages/footer.jsp" />

<definition name="admin.tiles" extends="baseLayout">
<put-attribute name="movie_list" value="/home_screen_pages/adminlogin.jsp" />

<definition name="contactUs.tiles" extends="baseLayout">
<put-attribute name="movie_list" value="/home_screen_pages/contactus.jsp" />

<definition name="aboutUs.tiles" extends="baseLayout">
<put-attribute name="movie_list" value="/home_screen_pages/aboutus.jsp" />

<definition name="/customer.success.tiles" extends="baseLayout">
<put-attribute name="title" value="Customer Added" />
<put-attribute name="body" value="/SuccessCustomer.jsp" />


I agree. Here's the link:
subject: The requested resource (There is no Action mapped for namespace / and action name admin-login.)
It's not a secret anymore!