Wrox Programmer Forums

Need to download code?

View our list of code downloads.

Go Back   Wrox Programmer Forums > Java > Java Open Source > Struts
Password Reminder
Register
| FAQ | Members List | Calendar | Search | Today's Posts | Mark Forums Read
Welcome to the p2p.wrox.com Forums.

You are currently viewing the Struts section of the Wrox Programmer to Programmer discussions. This is a community of tens of thousands of software programmers and website developers including Wrox book authors and readers. As a guest, you can read any forum posting. By joining today you can post your own programming questions, respond to other developers’ questions, and eliminate the ads that are displayed to guests. Registration is fast, simple and absolutely free .
DRM-free e-books 300x50
Reply
 
Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Old October 24th, 2007, 11:09 PM
Authorized User
 
Join Date: Oct 2007
Location: Lucknow, UP, India.
Posts: 14
Thanks: 0
Thanked 0 Times in 0 Posts
Default HTTP status 404-Servlet action is not available

Hi There

I am using JBoss 4.0.2 GA, Netbeans 5.5.1 and Oracle 10g Express Edition as DBMS. I am using struts 1.2(bundled with Netbeans). I have Stucked around a problem as stated above.

Here are the Details:

Well Here are my sections of struts-config.xml

<form-beans>
        <form-bean name="logon" type="org.apache.struts.action.DynaActionForm">
          <form-property name="username" type="java.lang.String"/>
          <form-property name="password" type="java.lang.String"/>
        </form-bean>
    </form-beans>

<action-mappings>
        <action name="logon" path="/logon"
            type="com.SMS.view.logon" scope="request" >
              <forward name="success.admin" path="/pages/admin.jsp"/>
              <forward name="success.hod" path="/pages/hod.jsp"/>
              <forward name="success.hr" path="/pages/hr.jsp"/>
              <forward name="sucess.admission" path="/pages/admission/jsp"/>
              <forward name="Fails" path="/pages/welcome.jsp"/>
    </action>
    </action-mappings>


web.xml
<servlet>
        <servlet-name>action</servlet-name>
        <servlet-class>org.apache.struts.action.ActionServlet</servlet-class>
        <init-param>
            <param-name>config</param-name>
            <param-value>/WEB-INF/struts-config.xml</param-value>
        </init-param>
        <init-param>
            <param-name>debug</param-name>
            <param-value>2</param-value>
        </init-param>
        <init-param>
            <param-name>detail</param-name>
            <param-value>2</param-value>
        </init-param>
        <load-on-startup>1</load-on-startup>
        </servlet>
    <servlet-mapping>
        <servlet-name>action</servlet-name>
        <url-pattern>*.do</url-pattern>
    </servlet-mapping>

Now My action servlet that extends action -- logon.java in package com.SMS.view
public class logon extends Action {

    public ActionForward execute(ActionMapping mapping, ActionForm form,
                                 HttpServletRequest request,
                                 HttpServletResponse response) throws IOException,
                                                                      ServletException {

              String uid=(String)((DynaActionForm)form).get("username") ;
        String pass=(String)((DynaActionForm)form).get("password" );
        CheckUser chk=new CheckUser();
        LoginType lgs=chk.getValidUser(uid, pass);

           if(lgs.isIsValid()&& lgs.getType().equals("admin"))
                  return mapping.findForward("success.admin");
        else if (lgs.isIsValid()&& lgs.getType().equals("hod"))
            return mapping.findForward("success.hod");
        else if (lgs.isIsValid()&& lgs.getType().equals("hr"))
            return mapping.findForward("success.hr");
        else if (lgs.isIsValid()&& lgs.getType().equals("admission"))
            return mapping.findForward("success.admission");
        else
        {
             HttpSession ss=request.getSession();
             ss.setAttribute("loginErrorMsg","Please check username or Password");
             return mapping.findForward("Fails");
        }
    }
}

Finally my JSP page.
<html:form action="/logon.do">
            <table cellspacing="2" cellpadding="3" border="2" width="50%"
                   height="48">
                <tr>
                    <th width="26%">
                        Username
                    </th>
                    <td width="74%">
                        <html:text property="username"/>
                    </td>
                </tr>
                <tr>
                    <th width="26%">
                        Password
                    </th>
                    <td width="74%">
                        <html:password property="password"/>
                    </td>
                </tr>
                <tr>
                    <th width="26%">

                    </th>
                    <td width="74%">
                        <html:submit/>
                    </td>
                </tr>
                <tr>
                    <th width="26%" colspan="2">
         <%
            String loginerrormsg = null;
            loginerrormsg = (String) session.getAttribute("loginErrorMsg");
            if (loginerrormsg != null) {
        %>
        <H4>
            <%= loginerrormsg %>
        </H4><p>
        <%
            }
        %>
                    </th>
                </tr>
            </table>
        </html:form>

On running the project and logging in I am facing error of
HTTP status 404- Servlet action is not available

Please tell me how to figure this out?

Regards,
Ankur-programmer.net

Reply With Quote
Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are Off
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
HTTP Status 404 rivcam JSP Basics 7 June 3rd, 2008 09:32 PM
Ch28 - HTTP Status 503 - Servlet action is current mona3000m BOOK: Beginning JavaServer Pages 0 December 3rd, 2006 04:19 AM
Status 404 for 404 page marun BOOK: Professional Apache Tomcat 0 August 30th, 2005 06:45 AM
HTTP Status 405 - HTTP method GET .... nsakic Servlets 1 January 25th, 2004 04:50 PM
HTTP status 404 brianjs JSP Basics 2 October 26th, 2003 03:06 PM



All times are GMT -4. The time now is 02:37 PM.


Powered by vBulletin®
Copyright ©2000 - 2019, Jelsoft Enterprises Ltd.
© 2013 John Wiley & Sons, Inc.