Thanks.  I went with option number two.  It's more correct for what I want
to do.

-----Original Message-----
From: Craig R. McClanahan [mailto:[EMAIL PROTECTED]]
Sent: Thursday, March 15, 2001 10:28
To: '[EMAIL PROTECTED]'
Subject: Re: logic:equal and nesting




On Thu, 15 Mar 2001, Kyle Robinson wrote:

> Here's a piece of code that I want to do.  However it gives a nested tag
> error as the closing </logic:equal> tag ends up inside the <html:form>. I
> basically want the form to do different actions based on the property
> "title".  Anyone know of a better way of doing the same thing?
>  
> <logic:equal name="supplierSearchBean" property="title"
>             scope="request" value="Contractor">
>   <html:form action="contractorSearch.do">
> </logic:equal>
> <logic:equal name="supplierSearchBean" property="title"
>             scope="request" value="Supplier">
>   <html:form action="supplierSearch.do">
> </logic:equal>
> 

As the error message tells you, this is invalid nesting of tags.  In order
to change the destination of the submit, you will need to create some
JavaScript that does so on the client side, perhaps when the submit button
is presed.  (If you do this, be sure you use the same form bean on all of
the actions, or Struts is likely to get confused.)

Alternatively, you could have the <html:form> tag submit to a single
action, (say, "/commonSearch.do") which could then look at the title
property itself and then forward to either "/contractorSearch.do" or
"/supplierSearch.do" appropriately.

> 
> Kyle Robinson 
> Systems Consultant 
> Pangaea Systems Inc. 
> (250) 360-0111 
> 
>  
> 
Craig

Reply via email to