You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@struts.apache.org by Jim Kennedy <ji...@gigaheads.com> on 2003/10/24 22:39:46 UTC

Re: Having trouble with html:form tag - Using 1.1 - THAT WORKED

But why.  I don't understand.  I should be able to define:

/pm/*
/hello/*
/anything/* to the Struts action servlet.  It's doing weird things here.
It's not able to figure out that I am using /pm/...  I guess because it's
getting confused by all the other subcontexts.  It should be using the
sample context/subcontext as the form itself.

Do you think this is a bug?  Or should I avoid /this/*  and /that/* ?  How
would I do security on some but not all then?

Jim Kennedy
IT Consultant
Mobile Phone: 813-503-1484
-----------------------------------------------------


----- Original Message -----
From: <VK...@aaamissouri.com>
To: "Struts Users Mailing List" <st...@jakarta.apache.org>
Sent: Friday, October 24, 2003 4:21 PM
Subject: Re: Having trouble with html:form tag - Using 1.1 - NO luck


> try changing your mapping in web.xml to  *.do  and the for your form
> <html:form name="myForm" method="post" action="myAction.do"
>         type="aaa.ers.struts.forms.myForm">
> and in ur config file
>
> <action name="myForm" path="/myAction" parameter="methodtocall"
scope="request" type="aaa.ers.struts.actions.myAction" validate="false">
>
> change ur mapping............
>
>
>
>
>
> "Jim Kennedy" <ji...@gigaheads.com>
> 10/24/2003 03:12 PM
> Please respond to "Struts Users Mailing List"
>
>
>         To:     "Struts Users Mailing List"
<st...@jakarta.apache.org>
>         cc:
>         Subject:        Re: Having trouble with html:form tag - Using
1.1 - NO luck
>
>
> Validate method is not being fired.  I placed debug log messages in
> validate
> method.  I do see the form class loaded by the class loader though.  I'm
> using JBOSS with Tomcat 4.1.24
>
> Could it have something to do with the fact that I have multiple uri's
> mapped to the action servlet.  But I am not using modules.
>
> Jim Kennedy
> IT Consultant
> Mobile Phone: 813-503-1484
> -----------------------------------------------------
>
>
> ----- Original Message -----
> From: <VK...@aaamissouri.com>
> To: "Struts Users Mailing List" <st...@jakarta.apache.org>
> Sent: Friday, October 24, 2003 3:48 PM
> Subject: RE: Having trouble with html:form tag - Using 1.1
>
>
> > Is it possible since you are using validation; validate="true" that your
> > validation is failing and that is why ur action doesn't run???debug for
> > validate method in actionform bean?
> >
> >
> >
> >
> > "Chen, Gin" <Gi...@NielsenMedia.com>
> > 10/24/2003 02:32 PM
> > Please respond to "Struts Users Mailing List"
> >
> >
> >         To:     "'Struts Users Mailing List'"
> <st...@jakarta.apache.org>
> >         cc:
> >         Subject:        RE: Having trouble with html:form tag - Using
> 1.1
> >
> >
> > Don't know if this will do anything but change
> > <html:form action="pmregister">
> > To
> > <html:form action="/pmregister">
> >
> > From the struts-html guide:
> > "If you are using path mapping to select the controller servlet, this
> > value
> > should be exactly equal to the path attribute of the corresponding
> > <action>
> > element."
> >
> > Note the "exactly equal to"
> > -Tim
> >
> > -----Original Message-----
> > From: Jim Kennedy [mailto:jimk@gigaheads.com]
> > Sent: Friday, October 24, 2003 3:05 PM
> > To: Struts Users Mailing List
> > Subject: Re: Having trouble with html:form tag - Using 1.1
> >
> >
> > I took out those attributes from the html:form tag , but the results
> were
> > exactly the same.  This is weird.  My setup looks correct.
> >
> > > > Here's my struts XML:
> > > >
> > > > <form-bean
> > > > name="pmRegisterForm"
> > > > type="com.je.struts.action.PMRegisterForm">
> > > > </form-bean>
> > > > .....
> > > >
> > > > <action path="/pmregister"
> > > >     type="com.je.struts.action.PMRegisterAction"
> > > >     scope="request"
> > > >     name="pmRegisterForm"
> > > >
> > >
> input="/tmpl_main.jsp?page=/main/pm/regform.jsp&amp;page_title=Property
> > > > Management Services"
> > > >     validate="true">
> > > > <forward name="fees"
> > > > path="/tmpl_main.jsp?page=/main/pm/fees.jsp&amp;page_title=Property
> > > > Management Services"/>
> > > > </action>
> > > >
> >
> >
> > I think is has something to do with my servlet mappings.  It also seems
> > odd
> > to me that the generated action in the generated page is /webapp. Where
> > /webapp is my context.  This I believe to be a problem also.
> >
> > Not sure.  Any suggestions.
> >
> >
> > Jim Kennedy
> > IT Consultant
> > Mobile Phone: 813-503-1484
> > -----------------------------------------------------
> >
> >
> > ----- Original Message -----
> > From: "Chen, Gin" <Gi...@NielsenMedia.com>
> > To: "'Struts Users Mailing List'" <st...@jakarta.apache.org>
> > Sent: Friday, October 24, 2003 1:58 PM
> > Subject: RE: Having trouble with html:form tag - Using 1.1
> >
> >
> > > 1.1 doesn't have the type and name anymore.
> > > Try to take that out and then show us how you have struts-config for
> > that
> > > action setup.
> > > -Tim
> > >
> > > -----Original Message-----
> > > From: Jim Kennedy [mailto:jimk@gigaheads.com]
> > > Sent: Friday, October 24, 2003 1:51 PM
> > > To: Struts Users Mailing List
> > > Subject: Re: Having trouble with html:form tag - Using 1.1
> > >
> > >
> > > 1.1
> > >
> > > Jim Kennedy
> > > IT Consultant
> > > Mobile Phone: 813-503-1484
> > > -----------------------------------------------------
> > >
> > >
> > > ----- Original Message -----
> > > From: "Chen, Gin" <Gi...@NielsenMedia.com>
> > > To: "'Struts Users Mailing List'" <st...@jakarta.apache.org>
> > > Sent: Friday, October 24, 2003 1:48 PM
> > > Subject: RE: Having trouble with html:form tag
> > >
> > >
> > > > First off.. What version of Struts are you using?
> > > > This appears to be an older version as type/name are deprecated.
> > > > You should be have setting those in the struts-config.
> > > > Also make sure your action matches the action path in your
> > struts-config.
> > > > -Tim
> > > >
> > > > -----Original Message-----
> > > > From: Jim Kennedy [mailto:jimk@gigaheads.com]
> > > > Sent: Friday, October 24, 2003 1:42 PM
> > > > To: Struts Users Mailing List
> > > > Subject: Having trouble with html:form tag
> > > >
> > > >
> > > > This is my first shot at using 100% struts tags for my forms.  I'm
> > missing
> > > > something.
> > > >
> > > > snippet from jsp:
> > > >
> > > > <html:form action="pmregister" method="post" focus="firstName"
> > > > name="pmRegisterForm" type="com.je.struts.action.PMRegisterForm">
> > > > <!--<form action="pm/pmregister" method="post"> -->
> > > > <P>First name&nbsp;*&nbsp;: <html:text property="firstName"
> size="20"
> > > > maxlength="15"/></P>
> > > > <P>Last name&nbsp;*&nbsp;: <html:text property="lastName" size="20"
> > > > maxlength="20"/></P>
> > > > <P>Street&nbsp;*&nbsp;: <html:text property="street" size="20"
> > > > maxlength="20"/></P>
> > > > <P>City&nbsp;*&nbsp;: <html:text property="city" size="20"
> > > > maxlength="20"/></P>
> > > > <BR>
> > > > <BR>
> > > > <html:submit value="Submit" />
> > > > <!--</form> -->
> > > > </html:form>
> > > >
> > > >
> > > > You will notice the commented previous old form tag.  Here's what
> the
> > > > rendered "real" html looks like:
> > > >
> > > >
> > > >    <form name="pmRegisterForm" method="post" action="/webapp">
> > > >    <!--<form action="pm/pmregister" method="post"> -->
> > > >     <P>First name&nbsp;*&nbsp;: <input type="text" name="firstName"
> > > > maxlength="15" size="20" value=""></P>
> > > >     <P>Last name&nbsp;*&nbsp;: <input type="text" name="lastName"
> > > > maxlength="20" size="20" value=""></P>
> > > >     <P>Street&nbsp;*&nbsp;: <input type="text" name="street"
> > > maxlength="20"
> > > > size="20" value=""></P>
> > > >     <P>City&nbsp;*&nbsp;: <input type="text" name="city"
> > maxlength="20"
> > > > size="20" value=""></P>
> > > >
> > > >   <BR>
> > > >   <BR>
> > > >   <input type="submit" value="Submit">
> > > >   <!--</form> -->
> > > >   </form>
> > > > <script type="text/javascript" language="JavaScript">
> > > >   <!--
> > > >   var focusControl =
> > > document.forms["pmRegisterForm"].elements["firstName"];
> > > >
> > > >   if (focusControl.type != "hidden") {
> > > >      focusControl.focus();
> > > >   }
> > > >   // -->
> > > > </script>
> > > >
> > > >
> > > > Something is not right here.  Why is my action equal to the context?
> > When
> > > I
> > > > submit the form, I'm taken to the home page of my application.  The
> > struts
> > > > action does NOT run.
> > > >
> > > >
> > > >
> > > > Here's my struts XML:
> > > >
> > > > <form-bean
> > > > name="pmRegisterForm"
> > > > type="com.je.struts.action.PMRegisterForm">
> > > > </form-bean>
> > > > .....
> > > >
> > > > <action path="/pmregister"
> > > >     type="com.je.struts.action.PMRegisterAction"
> > > >     scope="request"
> > > >     name="pmRegisterForm"
> > > >
> > >
> input="/tmpl_main.jsp?page=/main/pm/regform.jsp&amp;page_title=Property
> > > > Management Services"
> > > >     validate="true">
> > > > <forward name="fees"
> > > > path="/tmpl_main.jsp?page=/main/pm/fees.jsp&amp;page_title=Property
> > > > Management Services"/>
> > > > </action>
> > > >
> > > >
> > > > I have /pm/* mapped to the main struts action servlet in web.xml.
> > > >
> > > > <servlet-mapping>
> > > > <servlet-name>ActionServlet</servlet-name>
> > > > <url-pattern>/pm/*</url-pattern>
> > > > </servlet-mapping>
> > > >
> > > > I also have many more mappings to the same servlet.  I'm not just
> > using
> > > > /go/*.
> > > >
> > > >
> ---------------------------------------------------------------------
> > > > To unsubscribe, e-mail: struts-user-unsubscribe@jakarta.apache.org
> > > > For additional commands, e-mail: struts-user-help@jakarta.apache.org
> > > >
> > >
> > >
> > > ---------------------------------------------------------------------
> > > To unsubscribe, e-mail: struts-user-unsubscribe@jakarta.apache.org
> > > For additional commands, e-mail: struts-user-help@jakarta.apache.org
> > >
> > > ---------------------------------------------------------------------
> > > To unsubscribe, e-mail: struts-user-unsubscribe@jakarta.apache.org
> > > For additional commands, e-mail: struts-user-help@jakarta.apache.org
> > >
> >
> >
> > ---------------------------------------------------------------------
> > To unsubscribe, e-mail: struts-user-unsubscribe@jakarta.apache.org
> > For additional commands, e-mail: struts-user-help@jakarta.apache.org
> >
> > ---------------------------------------------------------------------
> > To unsubscribe, e-mail: struts-user-unsubscribe@jakarta.apache.org
> > For additional commands, e-mail: struts-user-help@jakarta.apache.org
> >
> >
> >
> >
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: struts-user-unsubscribe@jakarta.apache.org
> For additional commands, e-mail: struts-user-help@jakarta.apache.org
>
>
>
>


---------------------------------------------------------------------
To unsubscribe, e-mail: struts-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: struts-user-help@jakarta.apache.org