You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@struts.apache.org by Janice <ja...@shaw.ca> on 2004/11/03 01:16:25 UTC

Need an alternative to bean:define

My brain has stopped working.  I need an alternative to bean:define.

What I'm TRYING to do is iterate through a list, displaying a certain bit of
code only when its different than the last iteration (grouping).

Here's a snip:

        <bean:define id="lastClientName" value="" />
       
        <logic:iterate id="widget" name="widgets">
        
        <logic:notEqual name="widget" property="clientName"
value="<%=lastClientName%>">
        <tr>
          <td colspan=all>
            client: <bean:write name="widget" property="clientName" />
          </td>
        </tr>
        <bean:define id="lastClientName" name="widget" property="clientName"
/>
        </logic:notEqual>

End of snip.

This won't compile since bean "lastClientName" has already been defined.  I
can't change my version of Struts.

What would be some clean syntax to use instead?

Thanks so much in advance!

J


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


Re: Need an alternative to bean:define

Posted by Matt Bathje <mp...@ntsource.com>.
Matt Bathje wrote:
> Janice -
> 
> I do multiple bean:defines (with values, not with name/property 
> attributes) in some of my jsps, and never have problems, and am 
> therefore assuming that the name/property attributes are causing the 
> problem.
> 
> Here may be a non-jstl workaround you can try:
> 
> <bean:define id="lastClientName">
>     <bean:write name="widget" property="clientName" />
> <bean:define>

Doh...of course END your previous bean:define instead of opening a new 
one :)

Matt

[snip rest of content]

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


Re: Need an alternative to bean:define

Posted by Matt Bathje <mp...@ntsource.com>.
Ahh, missed that one - note that it is JSP 1.1, not Struts 1.1.

Never had the limitation, so I can't help with workarounds, sorry!

Matt


Janice wrote:
> Thanks Matt, but I think my problem is that I'm using Struts 1.1 (and can't
> change it)
> 
> According to: http://struts.apache.org/userGuide/struts-bean.html#define
> 
> You can't re-define in 1.1.  There must be a workaround?
> 
> TIA,
> J
> 
> 
> -----Original Message-----
> From: Matt Bathje [mailto:mpb@ntsource.com]
> Sent: Wednesday, November 03, 2004 10:32 AM
> To: Struts Users Mailing List
> Subject: Re: Need an alternative to bean:define
> 
> 
> Janice -
> 
> I do multiple bean:defines (with values, not with name/property
> attributes) in some of my jsps, and never have problems, and am
> therefore assuming that the name/property attributes are causing the
> problem.
> 
> Here may be a non-jstl workaround you can try:
> 
> <bean:define id="lastClientName">
>         <bean:write name="widget" property="clientName" /> <bean:define>
> 
> 
> 
> Matt
> 
> 
> 
> 
> Janice wrote:
> 
>>Unfortunately, I need to get all kinds of approval to use JSTL, is
>>there no Struts tag that will do this?
>>
>>TIA,
>>J
>>
>>-----Original Message-----
>>From: atta-ur rehman [mailto:attaurrehman@gmail.com]
>>Sent: Tuesday, November 02, 2004 5:04 PM
>>To: Struts Users Mailing List
>>Subject: Re: Need an alternative to bean:define
>>
>>
>>Is JSTL an option? I find Struts Logic tag hard to read! If so, I
>>think this should do:
>>
>><c:set var="lastCN" value=""/>
>><logic:iterate...>
>><c:if test="${widget.clinetName != lastCN}">
>>  ....
>></c:if>
>><c:set var="lastCN" value="${widget.clientName}"/> </logic:iterate>
>>
>>HTH. Of course this is from top of my head, i haven't tried it.
>>
>>ATTA
>>
>>On Tue, 02 Nov 2004 16:16:25 -0800, Janice <ja...@shaw.ca> wrote:
>>
>>
>>>My brain has stopped working.  I need an alternative to bean:define.
>>>
>>>What I'm TRYING to do is iterate through a list, displaying a certain
>>>bit of code only when its different than the last iteration
>>>(grouping).
>>>
>>>Here's a snip:
>>>
>>>       <bean:define id="lastClientName" value="" />
>>>
>>>       <logic:iterate id="widget" name="widgets">
>>>
>>>       <logic:notEqual name="widget" property="clientName"
>>>value="<%=lastClientName%>">
>>>       <tr>
>>>         <td colspan=all>
>>>           client: <bean:write name="widget" property="clientName" />
>>>         </td>
>>>       </tr>
>>>       <bean:define id="lastClientName" name="widget"
>>>property="clientName" />
>>>       </logic:notEqual>
>>>
>>>End of snip.
>>>
>>>This won't compile since bean "lastClientName" has already been
>>>defined.  I can't change my version of Struts.
>>>
>>>What would be some clean syntax to use instead?
>>>
>>>Thanks so much in advance!
>>>
>>>J
>>>
>>>---------------------------------------------------------------------
>>>To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
>>>For additional commands, e-mail: user-help@struts.apache.org
>>>
>>>
>>
>>
>>
>>---------------------------------------------------------------------
>>To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
>>For additional commands, e-mail: user-help@struts.apache.org
>>
> 
> 
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
> For additional commands, e-mail: user-help@struts.apache.org


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


Re: Need an alternative to bean:define

Posted by Wendy Smoak <ja...@wendysmoak.com>.
From: "Janice" <ja...@shaw.ca>
> Thanks Matt, but I think my problem is that I'm using Struts 1.1 (and
can't
> change it)
> According to: http://struts.apache.org/userGuide/struts-bean.html#define
> You can't re-define in 1.1.  There must be a workaround?

Honestly, I'd last 2.5 seconds in a place that tied my hands behind my back
and said, "Now, type fast and make it work."  If they won't let you use JSTL
or Struts-EL or a newer version of Struts... fall back to scriptlets and see
how they like that. You already have an expression in there, so apparently
nobody is allergic to <%.

-- 
Wendy Smoak


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


[OT] Re: Need an alternative to bean:define

Posted by Erik Weber <er...@mindspring.com>.
Many times newer developers don't care so much about the academics of 
what is "proper". For example, they see the Struts tags and like them, 
and then become attached to them. It can be disconcerting to them to 
"find out" that they are using an outdated technology so soon after they 
have discovered something that made development more efficient and more 
fun than it had been before. The Java community at large should remain 
aware of this phenomenon. I say, if a tool is proven to work well for a 
particular job, it belongs in the box. In the context of programming, 
this presupposes some level of support and acceptance for the tool in 
the community.

I have been doing Swing/AWT development for about three years now. Over 
and over again I have implemented the same types of interface devices, 
scouring the Swing source code, examining stack traces and ever 
perfecting my use of Threads. I am just now beginning to get good at it. 
Every time a new Swing release comes out, I can't wait to find out what 
bugs have been fixed, what new devices are available for Linux that have 
been taken for granted on Windows, and the like. At the same time I see 
libraries emerge that promoters claim are the result of Swing's 
shortcomings, and I mostly find it ridiculous, given the context (time) 
and my own experience (Swing and Graphics 2D can do all sorts of amazing 
things). I hope Sun isn't affected much by it and continues on building 
and documenting Swing. Everyone is in too much of a hurry to go on to 
the next tool. Programmers who end up building things of substance reach 
for their trusted tools, devices, paradigms, etc., when they are 
inspired and want to get something done with confidence. Some of the 
best Java GUI applications I have seen will run on a (pre-Swing) 1.1 
JVM, and here there are people saying Swing is a wash.

Based on what I have read as a subscriber to this list, I conclude that 
many Struts users feel the same way about Struts as I do about Swing. 
They (myself included) greatly appreciate James' taglib tests, the 
ongoing efforts to build a better dispatch action and the work of all 
other contributors (not only committers). They breathe a collective sigh 
of relief when they see that Craig is writing papers about Struts 2.

Erik

P.S. This is no attack on Eddie's advice to prefer JSTL to the Struts 
tags. I often give the same advice.



James Mitchell wrote:

> As an FYI.  I don't think it is wise to say that the Struts taglibs 
> will be going away.  I am of the opinion that they will be around for 
> quite some time.  At least until JSF is adopted considered as the 
> default choice for all new web development.
>
>
> On a somewhat related note, do you even know how many hours I spent 
> creating those taglib tests?  ;)
>
>
>
> -- 
> James Mitchell
> Software Engineer / Open Source Evangelist
> EdgeTech, Inc.
> 678.910.8017
> AIM: jmitchtx
>
> ----- Original Message ----- From: "Eddie Bush" <ea...@swbell.net>
> To: "Struts Users Mailing List" <us...@struts.apache.org>
> Sent: Thursday, November 04, 2004 11:43 PM
> Subject: Re: Need an alternative to bean:define
>
>
>> My condolences :-(  I now see your rock and hard spot.
>>
>> It's not about bleeding edge though.  Of course, what counts in that 
>> regard is your clients' opinion of what bleeding edge is.
>>
>> Best of luck!
>>
>> Eddie
>>
>> ----- Original Message ----- From: "Janice" <ja...@shaw.ca>
>> To: "'Struts Users Mailing List'" <us...@struts.apache.org>
>> Sent: Thursday, November 04, 2004 12:25 PM
>> Subject: RE: Need an alternative to bean:define
>>
>>
>> I should point out that it isn't my company that has the 
>> restrictions.  My
>> employer would quite happily move to the bleeding edge of any 
>> technology if
>> there were any benefit to do so.  In this case the client has very 
>> definite
>> parameters we need to work within.  Their servers are set up in a 
>> certain
>> way and they have standards that must be followed or else we don't 
>> get paid.
>> I don't have to agree with their standards in order to take their 
>> money. ;)
>>
>> Thanks for the input all the same.
>>
>> J
>>
>> -----Original Message-----
>> From: Eddie Bush [mailto:eabush@swbell.net]
>> Sent: Wednesday, November 03, 2004 5:17 PM
>> To: Struts Users Mailing List
>> Subject: Re: Need an alternative to bean:define
>>
>>
>> I would question anyone who told me I had to use something that is going
>> away in the future (most of Struts' taglibs), instead of using a 
>> standard
>> technology (the JSTL).
>>
>> Are they fully-aware of the decision they're making?  Are you running 
>> within
>>
>> a container that supports Servlet Specification 2.3 and JSP 
>> Specification
>> 1.2?
>>
>> I can't conceive of anyone being so narrow-minded.  If I told my boss I
>> wanted to use the JSTL over Struts' taglibs (a conversation that 
>> would never
>>
>> take place because I'm able to do whatever I feel is best), citing 
>> that the
>> JSTL was a standard technology and that the Struts taglibs would be 
>> going
>> away, he'd thank me for the FYI and tell me to do what I felt was best.
>> We're very into using standards-compliant methodologies where it 
>> makes sense
>>
>> to do so though.
>>
>> Eddie
>>
>>
>> ---------------------------------------------------------------------
>> To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
>> For additional commands, e-mail: user-help@struts.apache.org
>>
>>
>>
>>
>> ---
>> avast! Antivirus: Outbound message clean.
>> Virus Database (VPS): 0445-1, 11/03/2004
>> Tested on: 11/4/2004 10:43:32 PM
>> avast! - copyright (c) 2000-2004 ALWIL Software.
>> http://www.avast.com
>>
>>
>>
>>
>> ---------------------------------------------------------------------
>> To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
>> For additional commands, e-mail: user-help@struts.apache.org
>>
>>
>
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
> For additional commands, e-mail: user-help@struts.apache.org
>
>

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


Re: Validator javascript generation errors

Posted by Ashwin Desai <as...@yahoo.com>.
I am using Struts 1.x. So, that kind of explains the problem. We will
move over to the latest version soon & that error should go away. 

Matt - Thanks a lot for your help.

Ashwin.





--- Matt Bathje <mp...@ntsource.com> wrote:

> Ashwin Desai wrote:
> > Hi,
> > 
> > I am having a problem with the javascript that is generated by
> the
> > validator framework. 
> > 
> > ** JAVASCRIPT **
> > 
> > Here is a snippet of the generated javascript
> > 
> >     function validate/testAction(form) {                         
>    
> >                                      
> 
> [snip]
> 
> > 
> > The server-side validations work fine but looks like the
> client-side
> > javascript creation needs to be updated to use a different name
> in
> > case the form name uses an Action path (containing /). 
> > 
> > Has anyone else seen this problem ? This could possibly be a bug
> in
> > Struts.
> > 
> 
> 
> Ashwin - what version of struts are you on?
> 
> This was a bug in older versions of struts 1.2 (possibly in 1.1 and
> 
> earlier too, but I'm not positive). Check out this bug: 
> http://issues.apache.org/bugzilla/show_bug.cgi?id=29796
> 
> This should be fixed in nightly builds after 7/1/04 or so, and in
> the 
> latest stable release (1.2.4).
> 
> 
> Matt
> 
>
---------------------------------------------------------------------
> To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
> For additional commands, e-mail: user-help@struts.apache.org
> 
> 


=====
Ashwin Desai.


		
__________________________________ 
Do you Yahoo!? 
Check out the new Yahoo! Front Page. 
www.yahoo.com 
 


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


Re: Validator javascript generation errors

Posted by Matt Bathje <mp...@ntsource.com>.
Ashwin Desai wrote:
> Hi,
> 
> I am having a problem with the javascript that is generated by the
> validator framework. 
> 
> ** JAVASCRIPT **
> 
> Here is a snippet of the generated javascript
> 
>     function validate/testAction(form) {                             
>                                      

[snip]

> 
> The server-side validations work fine but looks like the client-side
> javascript creation needs to be updated to use a different name in
> case the form name uses an Action path (containing /). 
> 
> Has anyone else seen this problem ? This could possibly be a bug in
> Struts.
> 


Ashwin - what version of struts are you on?

This was a bug in older versions of struts 1.2 (possibly in 1.1 and 
earlier too, but I'm not positive). Check out this bug: 
http://issues.apache.org/bugzilla/show_bug.cgi?id=29796

This should be fixed in nightly builds after 7/1/04 or so, and in the 
latest stable release (1.2.4).


Matt

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


Validator javascript generation errors

Posted by Ashwin Desai <as...@yahoo.com>.
Hi,

I am having a problem with the javascript that is generated by the
validator framework. 

** JAVASCRIPT **

Here is a snippet of the generated javascript

    function validate/testAction(form) {                             
                                     
        if (bCancel) 
      return true; 
        else 
       return validateRequired(form) && validateMinLength(form) &&
validateMask(form); 
   } 

Looking at the above snippet, the function name is invalid (contains
a /)

** VALIDATOR.XML **
Here is a snippet from my validator.xml file.

        <form name="/testAction">
            <field property="value(name)" depends="required,
minlength">
                <var>
                    <var-name>minlength</var-name>
                    <var-value>5</var-value>
                </var>
                <arg0 key="Name" resource="false">
        </form>


I use a Map-based ActionForm for this Action. Also, I have specified
the ActionMapping path as the form name because this ActionForm is
shared between many Actions. 

Check out
http://www.oracle.com/technology/oramag/oracle/04-jan/o14dev_struts.html
for more information on this.

The server-side validations work fine but looks like the client-side
javascript creation needs to be updated to use a different name in
case the form name uses an Action path (containing /). 

Has anyone else seen this problem ? This could possibly be a bug in
Struts.

Ashwin.



=====
Ashwin Desai.

__________________________________________________
Do You Yahoo!?
Tired of spam?  Yahoo! Mail has the best spam protection around 
http://mail.yahoo.com 

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


Re: Need an alternative to bean:define

Posted by James Mitchell <jm...@apache.org>.
As an FYI.  I don't think it is wise to say that the Struts taglibs will be 
going away.  I am of the opinion that they will be around for quite some 
time.  At least until JSF is adopted considered as the default choice for 
all new web development.


On a somewhat related note, do you even know how many hours I spent creating 
those taglib tests?  ;)



--
James Mitchell
Software Engineer / Open Source Evangelist
EdgeTech, Inc.
678.910.8017
AIM: jmitchtx

----- Original Message ----- 
From: "Eddie Bush" <ea...@swbell.net>
To: "Struts Users Mailing List" <us...@struts.apache.org>
Sent: Thursday, November 04, 2004 11:43 PM
Subject: Re: Need an alternative to bean:define


> My condolences :-(  I now see your rock and hard spot.
>
> It's not about bleeding edge though.  Of course, what counts in that 
> regard is your clients' opinion of what bleeding edge is.
>
> Best of luck!
>
> Eddie
>
> ----- Original Message ----- 
> From: "Janice" <ja...@shaw.ca>
> To: "'Struts Users Mailing List'" <us...@struts.apache.org>
> Sent: Thursday, November 04, 2004 12:25 PM
> Subject: RE: Need an alternative to bean:define
>
>
> I should point out that it isn't my company that has the restrictions.  My
> employer would quite happily move to the bleeding edge of any technology 
> if
> there were any benefit to do so.  In this case the client has very 
> definite
> parameters we need to work within.  Their servers are set up in a certain
> way and they have standards that must be followed or else we don't get 
> paid.
> I don't have to agree with their standards in order to take their money. 
> ;)
>
> Thanks for the input all the same.
>
> J
>
> -----Original Message-----
> From: Eddie Bush [mailto:eabush@swbell.net]
> Sent: Wednesday, November 03, 2004 5:17 PM
> To: Struts Users Mailing List
> Subject: Re: Need an alternative to bean:define
>
>
> I would question anyone who told me I had to use something that is going
> away in the future (most of Struts' taglibs), instead of using a standard
> technology (the JSTL).
>
> Are they fully-aware of the decision they're making?  Are you running 
> within
>
> a container that supports Servlet Specification 2.3 and JSP Specification
> 1.2?
>
> I can't conceive of anyone being so narrow-minded.  If I told my boss I
> wanted to use the JSTL over Struts' taglibs (a conversation that would 
> never
>
> take place because I'm able to do whatever I feel is best), citing that 
> the
> JSTL was a standard technology and that the Struts taglibs would be going
> away, he'd thank me for the FYI and tell me to do what I felt was best.
> We're very into using standards-compliant methodologies where it makes 
> sense
>
> to do so though.
>
> Eddie
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
> For additional commands, e-mail: user-help@struts.apache.org
>
>
>
>
> ---
> avast! Antivirus: Outbound message clean.
> Virus Database (VPS): 0445-1, 11/03/2004
> Tested on: 11/4/2004 10:43:32 PM
> avast! - copyright (c) 2000-2004 ALWIL Software.
> http://www.avast.com
>
>
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
> For additional commands, e-mail: user-help@struts.apache.org
>
> 



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


Re: Need an alternative to bean:define

Posted by Eddie Bush <ea...@swbell.net>.
My condolences :-(  I now see your rock and hard spot.

It's not about bleeding edge though.  Of course, what counts in that regard 
is your clients' opinion of what bleeding edge is.

Best of luck!

Eddie

----- Original Message ----- 
From: "Janice" <ja...@shaw.ca>
To: "'Struts Users Mailing List'" <us...@struts.apache.org>
Sent: Thursday, November 04, 2004 12:25 PM
Subject: RE: Need an alternative to bean:define


I should point out that it isn't my company that has the restrictions.  My
employer would quite happily move to the bleeding edge of any technology if
there were any benefit to do so.  In this case the client has very definite
parameters we need to work within.  Their servers are set up in a certain
way and they have standards that must be followed or else we don't get paid.
I don't have to agree with their standards in order to take their money.  ;)

Thanks for the input all the same.

J

-----Original Message-----
From: Eddie Bush [mailto:eabush@swbell.net]
Sent: Wednesday, November 03, 2004 5:17 PM
To: Struts Users Mailing List
Subject: Re: Need an alternative to bean:define


I would question anyone who told me I had to use something that is going
away in the future (most of Struts' taglibs), instead of using a standard
technology (the JSTL).

Are they fully-aware of the decision they're making?  Are you running within

a container that supports Servlet Specification 2.3 and JSP Specification
1.2?

I can't conceive of anyone being so narrow-minded.  If I told my boss I
wanted to use the JSTL over Struts' taglibs (a conversation that would never

take place because I'm able to do whatever I feel is best), citing that the
JSTL was a standard technology and that the Struts taglibs would be going
away, he'd thank me for the FYI and tell me to do what I felt was best.
We're very into using standards-compliant methodologies where it makes sense

to do so though.

Eddie


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




---
avast! Antivirus: Outbound message clean.
Virus Database (VPS): 0445-1, 11/03/2004
Tested on: 11/4/2004 10:43:32 PM
avast! - copyright (c) 2000-2004 ALWIL Software.
http://www.avast.com




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


RE: Need an alternative to bean:define

Posted by Janice <ja...@shaw.ca>.
I should point out that it isn't my company that has the restrictions.  My
employer would quite happily move to the bleeding edge of any technology if
there were any benefit to do so.  In this case the client has very definite
parameters we need to work within.  Their servers are set up in a certain
way and they have standards that must be followed or else we don't get paid.
I don't have to agree with their standards in order to take their money.  ;)

Thanks for the input all the same.

J

-----Original Message-----
From: Eddie Bush [mailto:eabush@swbell.net] 
Sent: Wednesday, November 03, 2004 5:17 PM
To: Struts Users Mailing List
Subject: Re: Need an alternative to bean:define


I would question anyone who told me I had to use something that is going 
away in the future (most of Struts' taglibs), instead of using a standard 
technology (the JSTL).

Are they fully-aware of the decision they're making?  Are you running within

a container that supports Servlet Specification 2.3 and JSP Specification 
1.2?

I can't conceive of anyone being so narrow-minded.  If I told my boss I 
wanted to use the JSTL over Struts' taglibs (a conversation that would never

take place because I'm able to do whatever I feel is best), citing that the 
JSTL was a standard technology and that the Struts taglibs would be going 
away, he'd thank me for the FYI and tell me to do what I felt was best. 
We're very into using standards-compliant methodologies where it makes sense

to do so though.

Eddie


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


Re: Need an alternative to bean:define

Posted by Eddie Bush <ea...@swbell.net>.
I would question anyone who told me I had to use something that is going 
away in the future (most of Struts' taglibs), instead of using a standard 
technology (the JSTL).

Are they fully-aware of the decision they're making?  Are you running within 
a container that supports Servlet Specification 2.3 and JSP Specification 
1.2?

I can't conceive of anyone being so narrow-minded.  If I told my boss I 
wanted to use the JSTL over Struts' taglibs (a conversation that would never 
take place because I'm able to do whatever I feel is best), citing that the 
JSTL was a standard technology and that the Struts taglibs would be going 
away, he'd thank me for the FYI and tell me to do what I felt was best. 
We're very into using standards-compliant methodologies where it makes sense 
to do so though.

Eddie

----- Original Message ----- 
From: "Janice" <ja...@shaw.ca>
To: "'Struts Users Mailing List'" <us...@struts.apache.org>
Sent: Wednesday, November 03, 2004 1:06 PM
Subject: RE: Need an alternative to bean:define


> Thanks Matt, but I think my problem is that I'm using Struts 1.1 (and 
> can't
> change it)
>
> According to: http://struts.apache.org/userGuide/struts-bean.html#define
>
> You can't re-define in 1.1.  There must be a workaround?
>
> TIA,
> J
>
>
> -----Original Message-----
> From: Matt Bathje [mailto:mpb@ntsource.com]
> Sent: Wednesday, November 03, 2004 10:32 AM
> To: Struts Users Mailing List
> Subject: Re: Need an alternative to bean:define
>
>
> Janice -
>
> I do multiple bean:defines (with values, not with name/property
> attributes) in some of my jsps, and never have problems, and am
> therefore assuming that the name/property attributes are causing the
> problem.
>
> Here may be a non-jstl workaround you can try:
>
> <bean:define id="lastClientName">
>        <bean:write name="widget" property="clientName" /> <bean:define>
>
>
>
> Matt
>
>
>
>
> Janice wrote:
>> Unfortunately, I need to get all kinds of approval to use JSTL, is
>> there no Struts tag that will do this?
>>
>> TIA,
>> J
>>
>> -----Original Message-----
>> From: atta-ur rehman [mailto:attaurrehman@gmail.com]
>> Sent: Tuesday, November 02, 2004 5:04 PM
>> To: Struts Users Mailing List
>> Subject: Re: Need an alternative to bean:define
>>
>>
>> Is JSTL an option? I find Struts Logic tag hard to read! If so, I
>> think this should do:
>>
>> <c:set var="lastCN" value=""/>
>> <logic:iterate...>
>> <c:if test="${widget.clinetName != lastCN}">
>>   ....
>> </c:if>
>> <c:set var="lastCN" value="${widget.clientName}"/> </logic:iterate>
>>
>> HTH. Of course this is from top of my head, i haven't tried it.
>>
>> ATTA
>>
>> On Tue, 02 Nov 2004 16:16:25 -0800, Janice <ja...@shaw.ca> wrote:
>>
>>>My brain has stopped working.  I need an alternative to bean:define.
>>>
>>>What I'm TRYING to do is iterate through a list, displaying a certain
>>>bit of code only when its different than the last iteration
>>>(grouping).
>>>
>>>Here's a snip:
>>>
>>>        <bean:define id="lastClientName" value="" />
>>>
>>>        <logic:iterate id="widget" name="widgets">
>>>
>>>        <logic:notEqual name="widget" property="clientName"
>>>value="<%=lastClientName%>">
>>>        <tr>
>>>          <td colspan=all>
>>>            client: <bean:write name="widget" property="clientName" />
>>>          </td>
>>>        </tr>
>>>        <bean:define id="lastClientName" name="widget"
>>>property="clientName" />
>>>        </logic:notEqual>
>>>
>>>End of snip.
>>>
>>>This won't compile since bean "lastClientName" has already been
>>>defined.  I can't change my version of Struts.
>>>
>>>What would be some clean syntax to use instead?
>>>
>>>Thanks so much in advance!
>>>
>>>J
>>>
>>>---------------------------------------------------------------------
>>>To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
>>>For additional commands, e-mail: user-help@struts.apache.org
>>>
>>>
>>
>>
>>
>> ---------------------------------------------------------------------
>> To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
>> For additional commands, e-mail: user-help@struts.apache.org
>>
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
> For additional commands, e-mail: user-help@struts.apache.org
>
> 



---
avast! Antivirus: Outbound message clean.
Virus Database (VPS): 0445-1, 11/03/2004
Tested on: 11/3/2004 7:16:52 PM
avast! - copyright (c) 2000-2004 ALWIL Software.
http://www.avast.com




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


RE: Need an alternative to bean:define

Posted by Janice <ja...@shaw.ca>.
Thanks Matt, but I think my problem is that I'm using Struts 1.1 (and can't
change it)

According to: http://struts.apache.org/userGuide/struts-bean.html#define

You can't re-define in 1.1.  There must be a workaround?

TIA,
J


-----Original Message-----
From: Matt Bathje [mailto:mpb@ntsource.com]
Sent: Wednesday, November 03, 2004 10:32 AM
To: Struts Users Mailing List
Subject: Re: Need an alternative to bean:define


Janice -

I do multiple bean:defines (with values, not with name/property
attributes) in some of my jsps, and never have problems, and am
therefore assuming that the name/property attributes are causing the
problem.

Here may be a non-jstl workaround you can try:

<bean:define id="lastClientName">
        <bean:write name="widget" property="clientName" /> <bean:define>



Matt




Janice wrote:
> Unfortunately, I need to get all kinds of approval to use JSTL, is
> there no Struts tag that will do this?
>
> TIA,
> J
>
> -----Original Message-----
> From: atta-ur rehman [mailto:attaurrehman@gmail.com]
> Sent: Tuesday, November 02, 2004 5:04 PM
> To: Struts Users Mailing List
> Subject: Re: Need an alternative to bean:define
>
>
> Is JSTL an option? I find Struts Logic tag hard to read! If so, I
> think this should do:
>
> <c:set var="lastCN" value=""/>
> <logic:iterate...>
> <c:if test="${widget.clinetName != lastCN}">
>   ....
> </c:if>
> <c:set var="lastCN" value="${widget.clientName}"/> </logic:iterate>
>
> HTH. Of course this is from top of my head, i haven't tried it.
>
> ATTA
>
> On Tue, 02 Nov 2004 16:16:25 -0800, Janice <ja...@shaw.ca> wrote:
>
>>My brain has stopped working.  I need an alternative to bean:define.
>>
>>What I'm TRYING to do is iterate through a list, displaying a certain
>>bit of code only when its different than the last iteration
>>(grouping).
>>
>>Here's a snip:
>>
>>        <bean:define id="lastClientName" value="" />
>>
>>        <logic:iterate id="widget" name="widgets">
>>
>>        <logic:notEqual name="widget" property="clientName"
>>value="<%=lastClientName%>">
>>        <tr>
>>          <td colspan=all>
>>            client: <bean:write name="widget" property="clientName" />
>>          </td>
>>        </tr>
>>        <bean:define id="lastClientName" name="widget"
>>property="clientName" />
>>        </logic:notEqual>
>>
>>End of snip.
>>
>>This won't compile since bean "lastClientName" has already been
>>defined.  I can't change my version of Struts.
>>
>>What would be some clean syntax to use instead?
>>
>>Thanks so much in advance!
>>
>>J
>>
>>---------------------------------------------------------------------
>>To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
>>For additional commands, e-mail: user-help@struts.apache.org
>>
>>
>
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
> For additional commands, e-mail: user-help@struts.apache.org
>


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


Re: Need an alternative to bean:define

Posted by Matt Bathje <mp...@ntsource.com>.
Janice -

I do multiple bean:defines (with values, not with name/property 
attributes) in some of my jsps, and never have problems, and am 
therefore assuming that the name/property attributes are causing the 
problem.

Here may be a non-jstl workaround you can try:

<bean:define id="lastClientName">
	<bean:write name="widget" property="clientName" />
<bean:define>



Matt




Janice wrote:
> Unfortunately, I need to get all kinds of approval to use JSTL, is there no
> Struts tag that will do this?
> 
> TIA,
> J
> 
> -----Original Message-----
> From: atta-ur rehman [mailto:attaurrehman@gmail.com] 
> Sent: Tuesday, November 02, 2004 5:04 PM
> To: Struts Users Mailing List
> Subject: Re: Need an alternative to bean:define
> 
> 
> Is JSTL an option? I find Struts Logic tag hard to read! If so, I think this
> should do:
> 
> <c:set var="lastCN" value=""/>
> <logic:iterate...>
> <c:if test="${widget.clinetName != lastCN}">
>   ....
> </c:if>
> <c:set var="lastCN" value="${widget.clientName}"/> </logic:iterate>
> 
> HTH. Of course this is from top of my head, i haven't tried it.
> 
> ATTA
> 
> On Tue, 02 Nov 2004 16:16:25 -0800, Janice <ja...@shaw.ca> wrote:
> 
>>My brain has stopped working.  I need an alternative to bean:define.
>>
>>What I'm TRYING to do is iterate through a list, displaying a certain 
>>bit of code only when its different than the last iteration 
>>(grouping).
>>
>>Here's a snip:
>>
>>        <bean:define id="lastClientName" value="" />
>>
>>        <logic:iterate id="widget" name="widgets">
>>
>>        <logic:notEqual name="widget" property="clientName" 
>>value="<%=lastClientName%>">
>>        <tr>
>>          <td colspan=all>
>>            client: <bean:write name="widget" property="clientName" />
>>          </td>
>>        </tr>
>>        <bean:define id="lastClientName" name="widget" 
>>property="clientName" />
>>        </logic:notEqual>
>>
>>End of snip.
>>
>>This won't compile since bean "lastClientName" has already been 
>>defined.  I can't change my version of Struts.
>>
>>What would be some clean syntax to use instead?
>>
>>Thanks so much in advance!
>>
>>J
>>
>>---------------------------------------------------------------------
>>To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
>>For additional commands, e-mail: user-help@struts.apache.org
>>
>>
> 
> 
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
> For additional commands, e-mail: user-help@struts.apache.org
> 


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


RE: Need an alternative to bean:define

Posted by Janice <ja...@shaw.ca>.
Unfortunately, I need to get all kinds of approval to use JSTL, is there no
Struts tag that will do this?

TIA,
J

-----Original Message-----
From: atta-ur rehman [mailto:attaurrehman@gmail.com] 
Sent: Tuesday, November 02, 2004 5:04 PM
To: Struts Users Mailing List
Subject: Re: Need an alternative to bean:define


Is JSTL an option? I find Struts Logic tag hard to read! If so, I think this
should do:

<c:set var="lastCN" value=""/>
<logic:iterate...>
<c:if test="${widget.clinetName != lastCN}">
  ....
</c:if>
<c:set var="lastCN" value="${widget.clientName}"/> </logic:iterate>

HTH. Of course this is from top of my head, i haven't tried it.

ATTA

On Tue, 02 Nov 2004 16:16:25 -0800, Janice <ja...@shaw.ca> wrote:
> My brain has stopped working.  I need an alternative to bean:define.
> 
> What I'm TRYING to do is iterate through a list, displaying a certain 
> bit of code only when its different than the last iteration 
> (grouping).
> 
> Here's a snip:
> 
>         <bean:define id="lastClientName" value="" />
> 
>         <logic:iterate id="widget" name="widgets">
> 
>         <logic:notEqual name="widget" property="clientName" 
> value="<%=lastClientName%>">
>         <tr>
>           <td colspan=all>
>             client: <bean:write name="widget" property="clientName" />
>           </td>
>         </tr>
>         <bean:define id="lastClientName" name="widget" 
> property="clientName" />
>         </logic:notEqual>
> 
> End of snip.
> 
> This won't compile since bean "lastClientName" has already been 
> defined.  I can't change my version of Struts.
> 
> What would be some clean syntax to use instead?
> 
> Thanks so much in advance!
> 
> J
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
> For additional commands, e-mail: user-help@struts.apache.org
> 
>


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


Re: Need an alternative to bean:define

Posted by atta-ur rehman <at...@gmail.com>.
Is JSTL an option? I find Struts Logic tag hard to read! If so, I
think this should do:

<c:set var="lastCN" value=""/>
<logic:iterate...>
<c:if test="${widget.clinetName != lastCN}">
  ....
</c:if>
<c:set var="lastCN" value="${widget.clientName}"/>
</logic:iterate>

HTH. Of course this is from top of my head, i haven't tried it.

ATTA

On Tue, 02 Nov 2004 16:16:25 -0800, Janice <ja...@shaw.ca> wrote:
> My brain has stopped working.  I need an alternative to bean:define.
> 
> What I'm TRYING to do is iterate through a list, displaying a certain bit of
> code only when its different than the last iteration (grouping).
> 
> Here's a snip:
> 
>         <bean:define id="lastClientName" value="" />
> 
>         <logic:iterate id="widget" name="widgets">
> 
>         <logic:notEqual name="widget" property="clientName"
> value="<%=lastClientName%>">
>         <tr>
>           <td colspan=all>
>             client: <bean:write name="widget" property="clientName" />
>           </td>
>         </tr>
>         <bean:define id="lastClientName" name="widget" property="clientName"
> />
>         </logic:notEqual>
> 
> End of snip.
> 
> This won't compile since bean "lastClientName" has already been defined.  I
> can't change my version of Struts.
> 
> What would be some clean syntax to use instead?
> 
> Thanks so much in advance!
> 
> J
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
> For additional commands, e-mail: user-help@struts.apache.org
> 
>

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