Results 1 to 4 of 4
  1. #1
    vaibhavspawar is offline Member
    Join Date
    Jun 2010
    Posts
    17
    Rep Power
    0

    Smile HTTP Status 404 - There is no Action mapped for action name showmainframe...

    Hello Friends...!!!
    Please help me out in this...
    I've done some programming in Struts2. When I run the application on server I get the error from Tomcat:

    HTTP Status 404 - There is no Action mapped for action name showmainframe.

    type Status report
    message There is no Action mapped for action name showmainframe.
    description The requested resource (There is no Action mapped for action name showmainframe.) is not available.

    I am using Eclipse IDE.
    My struts.xml is :

    <?xml version="1.0" encoding="UTF-8" ?>
    <!DOCTYPE struts PUBLIC "-//Apache Software Foundation//DTD Struts Configuration 2.0//EN" "http://struts.apache.org/dtds/struts-2.0.dtd">

    <struts>
    <constant name="struts.enable.DynamicMethodInvocation" value="false" />
    <constant name="struts.devMode" value="true" />
    <!-- <constant name="struts.custom.i18n.resources" value="ApplicationResources" />-->

    <package name="default" extends="struts-default" namespace="">

    <action name="showmainframe" method="execute" class="com.digicon.caproject.LoginAction">
    <result name="success">WebContent/MainFrame.jsp</result>
    <result name="error">Login.jsp</result>
    </action>

    </package>
    </struts>

    web.xml is :
    <?xml version="1.0" encoding="UTF-8"?>
    <web-app id="WebApp_ID" version="2.4" xmlns="http://java.sun.com/xml/ns/j2ee" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://java.sun.com/xml/ns/j2ee http://java.sun.com/xml/ns/j2ee/web-app_2_4.xsd">
    <display-name>Project_CA_StrutsIntegration</display-name>
    <filter>
    <filter-name>struts2</filter-name>
    <filter-class>org.apache.struts2.dispatcher.FilterDispatch er</filter-class>
    </filter>
    <filter-mapping>
    <filter-name>struts2</filter-name>
    <url-pattern>/*</url-pattern>
    </filter-mapping>
    <servlet>
    <description>
    </description>
    <display-name>LoginAction</display-name>
    <servlet-name>LoginAction</servlet-name>
    <servlet-class>com.digicon.caproject.LoginAction</servlet-class>
    </servlet>
    <servlet-mapping>
    <servlet-name>LoginAction</servlet-name>
    <url-pattern>/LoginAction</url-pattern>
    </servlet-mapping>
    <welcome-file-list>
    <welcome-file>LoginScreen.jsp</welcome-file>
    </welcome-file-list>
    </web-app>

    LoginScreen.jsp is :

    <%@ page import="java.awt.event.*" language="java" contentType="text/html; charset=ISO-8859-1" pageEncoding="ISO-8859-1"%>
    <%@ taglib prefix="stag" uri="/struts-tags" %>

    <!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
    <html>
    <head>
    <meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1">
    <!-- <META HTTP-EQUIV="Refresh" CONTENT="0;URL=com/digicon/caproject/showmainframe.action">-->
    <title>Login</title>
    <script type="text/javascript">
    function prePopulate()
    {
    loginForm.username.focus();
    }

    function capsLockStatus(e)
    {
    kc = e.keyCode?e.keyCode:e.which;
    sk = e.shiftKey?e.shiftKey:((kc == 16)?true:false);
    if(((kc >= 65 && kc <= 90) && !sk)||((kc >= 97 && kc <= 122) && sk))
    document.getElementById('divMayus').style.visibili ty = 'visible';
    else
    document.getElementById('divMayus').style.visibili ty = 'hidden';
    }

    function validate(loginForm)
    {
    alert("Inside validation....");
    var name = loginForm.username.value;
    var pass = loginForm.password.value;
    if(!name == "")
    {
    if(!pass == "")
    {
    alert("inside if" +loginForm.action);
    loginForm.submit();
    }
    else
    {
    alert("Please Enter Password");
    loginForm.password.focus();
    }
    }
    else
    {
    alert("Please Enter Username");
    loginForm.username.focus();
    }
    }
    </script>
    </head>
    <body topmargin="150" onload = "prePopulate()">
    <h1><center>Enter Login Details</center></h1>
    <stag:form name = "loginForm" method = "post" action="showmainframe">
    <table align = "center" width = 300>
    <tr>
    <td>
    <fieldset><legend>Login Details</legend>
    <table align = "center">
    <tr><td>&nbsp;</td></tr>
    <tr>
    <td>Username</td><td>&nbsp;</td><td><input type = "text" name = "username"></td>
    </tr>
    <tr><td></td></tr>
    <tr>
    <td>Password</td><td>&nbsp;</td><td><span><input type = "password" name = "password" onkeypress="capsLockStatus(event)"></span></td>
    </tr>
    <tr><td></td></tr>
    <tr><td>&nbsp;</td><td>&nbsp;</td><td><span><div id="divMayus" style="visibility:hidden"><font color="red"><b></>Caps Lock is ON</b></font></div></span></td></tr>
    <tr><td></td></tr>
    <tr>
    <td>&nbsp;</td><td>&nbsp;</td><td align = "right"><input type = "button" value = " Login " onClick = "validate(loginForm)">&nbsp;&nbsp;&nbsp;&nbsp;&nbs p;<input type = "reset" value = "Cancel"></td>
    </tr>
    </table>
    </fieldset>
    </td>
    </tr>
    </table>
    </stag:form>
    </body>
    </html>


    Please Help me ASAP...!!! :)

  2. #2
    Prajin's Avatar
    Prajin is offline Senior Member
    Join Date
    Jun 2010
    Location
    Ktm, Nepal
    Posts
    120
    Rep Power
    0

    Default

    HTTP status 404.... hu
    I haven't done Struts but just looking at error it clear says where to look for error.
    It's at Struts.xml.
    Java Code:
    <action name="showmainframe" method="execute" class="com.digicon.caproject.LoginAction">
    <result name="success">WebContent/MainFrame.jsp</result>
    I wonder, how come it's not like
    Java Code:
    <result name="success">/WebContent/MainFrame.jsp</result>
    And OP post should be in web section not here.

    -regards

  3. #3
    vaibhavspawar is offline Member
    Join Date
    Jun 2010
    Posts
    17
    Rep Power
    0

    Default

    Hey thanks Prajin....!!!
    Actually I've kept my struts.xml in WEB-INF folder. It should be in srcfolder. That's why I was getting that error. I'll also try your way. Thanks a lot.
    (Please Don't Mind but...)Where is this web section. Actually I saw all struts related posts here. So I posted it here. Will take care from next time.
    Thanks. :)

  4. #4
    Prajin's Avatar
    Prajin is offline Senior Member
    Join Date
    Jun 2010
    Location
    Ktm, Nepal
    Posts
    120
    Rep Power
    0

    Default

    I said you should post at web because, posting at right forum will help to get more replies.
    There is 'Java EE' forum where all web stuff's post can be found, look at navigation. This is 'General Java' forum, but there is no strict rules which says where you should post. It's all up to you.
    -regards

Similar Threads

  1. HTTP Status 500(problem)
    By waqar100 in forum NetBeans
    Replies: 1
    Last Post: 06-30-2010, 12:54 PM
  2. Replies: 7
    Last Post: 11-11-2009, 09:29 PM
  3. what does this means HTTP Status 500 -
    By gissah in forum New To Java
    Replies: 0
    Last Post: 03-28-2009, 04:27 AM
  4. HTTP Status 404 - Servlet action is not available---Error
    By sireesha in forum Web Frameworks
    Replies: 0
    Last Post: 04-18-2008, 08:25 PM
  5. HTTP Status 404 - Servlet action is not available
    By onceuponatime in forum Java Servlet
    Replies: 1
    Last Post: 12-11-2007, 05:29 PM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •