Actually I have the extension mapping set up as well.
The following is the web.xml file that I am using from
WEB-INF :

<?xml version="1.0" encoding="ISO-8859-1"?>

<!DOCTYPE web-app
  PUBLIC "-//Sun Microsystems, Inc.//DTD Web
Application 2.2//EN"
  "http://java.sun.com/j2ee/dtds/web-app_2_2.dtd";>

<web-app>



  <!-- Action Servlet Configuration -->
  <servlet>
    <servlet-name>action</servlet-name>
   
<servlet-class>org.apache.struts.action.ActionServlet</servlet-class>
    <init-param>
      <param-name>application</param-name>
      <param-value>ApplicationResources</param-value>
    </init-param>
    <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>
    <init-param>
      <param-name>validate</param-name>
      <param-value>true</param-value>
    </init-param>
    <load-on-startup>1</load-on-startup>
  </servlet>


  <!-- Action Servlet Mapping -->
  <servlet-mapping>
    <servlet-name>action</servlet-name>
    <url-pattern>*.do</url-pattern>
  </servlet-mapping>


  <!-- The Welcome File List -->
  <welcome-file-list>
    <welcome-file>login.jsp</welcome-file>
  </welcome-file-list>

  <!-- Struts Tag Library Descriptors -->
  <taglib>
    <taglib-uri>/WEB-INF/struts-bean.tld</taglib-uri>
   
<taglib-location>/WEB-INF/struts-bean.tld</taglib-location>
  </taglib>

  <taglib>
    <taglib-uri>/WEB-INF/struts-html.tld</taglib-uri>
   
<taglib-location>/WEB-INF/struts-html.tld</taglib-location>
  </taglib>

  <taglib>
    <taglib-uri>/WEB-INF/struts-logic.tld</taglib-uri>
   
<taglib-location>/WEB-INF/struts-logic.tld</taglib-location>
  </taglib>

</web-app>

--- Martin Cooper <[EMAIL PROTECTED]>
wrote:
> This is not related to the form. It looks like you
> may not have extension 
> mapping set up for your application. My guess is
> that if you type this in 
> your browser:
> 
> http://yourHost/pathToYourApp/login.do
> 
> you will also see a 404. That suggests that you need
> to add something like 
> this:
> 
>    <!-- Action Servlet Mapping -->
>    <servlet-mapping>
>      <servlet-name>action</servlet-name>
>      <url-pattern>*.do</url-pattern>
>    </servlet-mapping>
> 
> 
> to your web.xml file. You might want to take a look
> at the web.xml file in 
> the struts-example app to make sure you've got
> everything else that you need.
> 
> --
> Martin Cooper
> 
> 
> At 12:07 PM 8/9/01, Debasish Ghosh wrote:
> >Hi -
> >
> >I tried these and still no luck ... I am enclosing
> the
> >code for the Form.
> >
> >package com.anshin;
> >
> >import javax.servlet.http.HttpServletRequest;
> >import org.apache.struts.action.ActionError;
> >import org.apache.struts.action.ActionErrors;
> >import org.apache.struts.action.ActionForm;
> >import org.apache.struts.action.ActionMapping;
> >
> >public class LoginForm extends ActionForm
> >{
> >         private String password = null;
> >         private String username = null;
> >
> >         public String getPassword()
> >         {
> >                 System.out.println( "In
> getPassword" );
> >                 return (this.password);
> >         }
> >
> >         public void setPassword(String password)
> >         {
> >                 this.password = password;
> >         }
> >
> >         public String getUsername()
> >         {
> >                 System.out.println( "In
> getUsername" );
> >                 return (this.username);
> >         }
> >
> >         public void setUsername(String username)
> >         {
> >                 System.out.println( "In
> setUsername" );
> >                 this.username = username;
> >         }
> >
> >         public void reset(ActionMapping mapping,
> >HttpServletRequest request)
> >         {
> >                 System.out.println( "In reset" );
> >                 this.password = null;
> >                 this.username = null;
> >         }
> >
> >         public ActionErrors validate(ActionMapping
> mapping,
> >HttpServletRequest request)
> >         {
> >                 System.out.println( "In validate"
> );
> >             ActionErrors errors = new
> ActionErrors();
> >
> >             if ((username == null) ||
> (username.length() <
> >1))
> >                 {
> >                 errors.add("username", new
> >ActionError("error.username.required"));
> >                 }
> >             if ((password == null) ||
> (password.length() <
> >1))
> >                 {
> >                 errors.add("password", new
> >ActionError("error.password.required"));
> >                 }
> >             return errors;
> >         }
> >
> >}
> >
> >I am only getting the debug prints for "In
> >getUsername()" and "In getPassword()". Then the 404
> >error comes up. I have a print in the first line of
> >the action class, which is NOT getting printed.
> >
> >Cheers.
> >- Debasish
> >--- Rick Hightower <[EMAIL PROTECTED]> wrote:
> > > On your form make sure you have....
> > >
> > > <html:form action="/login" focus="name">
> > > ...
> > >
> > > Then define the following forward in your
> > > struts-config
> > >
> > > <forward name ="login" path="/login.do" />
> > > ...
> > >
> > > If this does not work, try including your form
> code
> > > so people can help you
> > > better.
> > >
> > > Rick Hightower
> > > Director of Development
> > > eBlox, Inc.
> > >
> > > Check out our new website!
> > > www.eblox.com
> > >
> > > Contact Info:
> > > eBlox Tucson
> > > phone: 520-615-9345 x103
> > > fax: 520-529-5774
> > >
> > > Rick's stuff:
> > > http://www.eblox.com/people_detail.php?id=52
> > > http://www.geocities.com/rick_m_hightower/
> > >
> http://www.brainbench.com/transcript.jsp?pid=2351036
> > >
> > >
> > > -----Original Message-----
> > > From: Debasish Ghosh
> [mailto:[EMAIL PROTECTED]]
> > > Sent: Wednesday, August 08, 2001 7:08 PM
> > > To: [EMAIL PROTECTED]
> > > Subject: newbie question
> > >
> > >
> > > Hi all -
> > >
> > > I am facing a weird problem, which I could not
> solve
> > > in the last couple of hours. I checked up the
> > > mail-archive but could not locate any solution
> to
> > > this.
> > >
> > > The application has a login screen (login.jsp),
> > > which
> > > validates a user. There is an ActionForm
> (LoginForm)
> > > with appropriate get and set methods.
> > >
> > > The struts-config.xml looks like :
> > >
> > >   <form-beans>
> > >
> > >     <!-- Logon form bean -->
> > >     <form-bean      name="loginForm"
> > >                    
> type="com.anshin.LoginForm"/>
> > >
> > >   </form-beans>
> > >
> > >     <!-- Process a user logon -->
> > >     <action    path="/login"
> > >                type="com.anshin.LoginAction"
> > >                name="loginForm"
> > >                validate="true"
> > >                input="login.jsp">
> > >
> > >              <forward name="success"
> > > path="/login.jsp"/>
> > >      </action>
> > >
> > > When I execute the application (invoke
> login.jsp), I
> > > get a 404 error on the page "login.do". I gave
> 
=== message truncated ===


__________________________________________________
Do You Yahoo!?
Make international calls for as low as $.04/minute with Yahoo! Messenger
http://phonecard.yahoo.com/

Reply via email to