Wrox Programmer Forums
Go Back   Wrox Programmer Forums > Java > Java Open Source > Struts
| 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 software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
  #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-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"/>

        <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"/>


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");
             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%"
                    <th width="26%">
                    <td width="74%">
                        <html:text property="username"/>
                    <th width="26%">
                    <td width="74%">
                        <html:password property="password"/>
                    <th width="26%">

                    <td width="74%">
                    <th width="26%" colspan="2">
            String loginerrormsg = null;
            loginerrormsg = (String) session.getAttribute("loginErrorMsg");
            if (loginerrormsg != null) {
            <%= loginerrormsg %>

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?


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

Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.