logic tag question

2008-11-05 Thread Russo, Joe
Hi,

I am trying to use a nested logic tag and I get an error:  equal symbol
expected

Any help would be appreciated.

Thanks,

Joe

 

Here is the code:

logic:greaterThan name=article property=parentArticleId value=0

logic:notEqual name=article property=parentArticleId
value=bean:write name=article property=articleMetaId/

img src=../images/icon_merged.png width=13
height=13 align=absmiddle

/logic:notEqual

/logic:greaterThan




RE: logic tag question

2008-11-05 Thread Kawczynski, David
You can't nest taglibs.
Try using the el tags and using an expression in place of the 
Nested bean:write taglib call. 

-Original Message-
From: Russo, Joe [mailto:[EMAIL PROTECTED] 
Sent: Wednesday, November 05, 2008 11:52 AM
To: user@struts.apache.org
Subject: logic tag question

Hi,

I am trying to use a nested logic tag and I get an error:  equal symbol
expected

Any help would be appreciated.

Thanks,

Joe

 

Here is the code:

logic:greaterThan name=article property=parentArticleId value=0

logic:notEqual name=article property=parentArticleId
value=bean:write name=article property=articleMetaId/

img src=../images/icon_merged.png width=13
height=13 align=absmiddle

/logic:notEqual

/logic:greaterThan



Notice:  This e-mail message, together with any attachments, contains
information of Merck  Co., Inc. (One Merck Drive, Whitehouse Station,
New Jersey, USA 08889), and/or its affiliates (which may be known
outside the United States as Merck Frosst, Merck Sharp  Dohme or
MSD and in Japan, as Banyu - direct contact information for affiliates is
available at http://www.merck.com/contact/contacts.html) that may be
confidential, proprietary copyrighted and/or legally privileged. It is
intended solely for the use of the individual or entity named on this
message. If you are not the intended recipient, and have received this
message in error, please notify us immediately by reply e-mail and
then delete it from your system.


-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Re: logic tag question

2008-11-05 Thread Dave Newton
The issue is the bean tag inside the logic tag; that isn't valid JSP. You'll 
need to use EL there via the EL tags or JSP 2.0 support, depending on your 
container.

Dave


--- On Wed, 11/5/08, Russo, Joe [EMAIL PROTECTED] wrote:

 From: Russo, Joe [EMAIL PROTECTED]
 Subject: logic tag question
 To: user@struts.apache.org
 Date: Wednesday, November 5, 2008, 11:51 AM
 Hi,
 
 I am trying to use a nested logic tag and I get an error: 
 equal symbol
 expected
 
 Any help would be appreciated.
 
 Thanks,
 
 Joe
 
  
 
 Here is the code:
 
 logic:greaterThan name=article
 property=parentArticleId value=0
 
 logic:notEqual name=article
 property=parentArticleId
 value=bean:write name=article
 property=articleMetaId/
 
 img
 src=../images/icon_merged.png
 width=13
 height=13 align=absmiddle
 
 /logic:notEqual
 
 /logic:greaterThan
 
 
 y

-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



RE: logic tag question

2008-11-05 Thread Russo, Joe
Thanks for your reply.

 

 

-Original Message-
From: Kawczynski, David [mailto:[EMAIL PROTECTED] 
Sent: Wednesday, November 05, 2008 11:59 AM
To: Struts Users Mailing List
Subject: RE: logic tag question

 

You can't nest taglibs.
Try using the el tags and using an expression in place of the
Nested bean:write taglib call.

-Original Message-
From: Russo, Joe [mailto:[EMAIL PROTECTED]
Sent: Wednesday, November 05, 2008 11:52 AM
To: user@struts.apache.org
Subject: logic tag question

Hi,

I am trying to use a nested logic tag and I get an error:  equal symbol
expected

Any help would be appreciated.

Thanks,

Joe



Here is the code:

logic:greaterThan name=article property=parentArticleId value=0

logic:notEqual name=article property=parentArticleId
value=bean:write name=article property=articleMetaId/

img src=../images/icon_merged.png width=13
height=13 align=absmiddle

/logic:notEqual

/logic:greaterThan



Notice:  This e-mail message, together with any attachments, contains
information of Merck  Co., Inc. (One Merck Drive, Whitehouse Station,
New Jersey, USA 08889), and/or its affiliates (which may be known
outside the United States as Merck Frosst, Merck Sharp  Dohme or
MSD and in Japan, as Banyu - direct contact information for affiliates
is
available at http://www.merck.com/contact/contacts.html) that may be
confidential, proprietary copyrighted and/or legally privileged. It is
intended solely for the use of the individual or entity named on this
message. If you are not the intended recipient, and have received this
message in error, please notify us immediately by reply e-mail and
then delete it from your system.


-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]







RE: logic tag question

2008-11-05 Thread Russo, Joe
Thanks for your reply.

 

-Original Message-
From: Dave Newton [mailto:[EMAIL PROTECTED] 
Sent: Wednesday, November 05, 2008 12:03 PM
To: Struts Users Mailing List
Subject: Re: logic tag question

 

The issue is the bean tag inside the logic tag; that isn't valid JSP.
You'll need to use EL there via the EL tags or JSP 2.0 support,
depending on your container.

Dave


--- On Wed, 11/5/08, Russo, Joe [EMAIL PROTECTED] wrote:

 From: Russo, Joe [EMAIL PROTECTED]
 Subject: logic tag question
 To: user@struts.apache.org
 Date: Wednesday, November 5, 2008, 11:51 AM
 Hi,

 I am trying to use a nested logic tag and I get an error:
 equal symbol
 expected

 Any help would be appreciated.

 Thanks,

 Joe

 

 Here is the code:

 logic:greaterThan name=article
 property=parentArticleId value=0

 logic:notEqual name=article
 property=parentArticleId
 value=bean:write name=article
 property=articleMetaId/

 img
 src=../images/icon_merged.png
 width=13
 height=13 align=absmiddle

 /logic:notEqual

 /logic:greaterThan


 y

-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]







Logic tag library

2008-02-13 Thread Allen, Daniel
Is there any reason we shouldn't use the Logic tab library
(http://struts.apache.org/tags-logic) with Struts 2? If so, is there any
subsitute? I'm looking specifically for logic:redirect and
logic:messagesPresent (along with the old html: messages)

~Dan Allen

-Original Message-
From: Zheng, Xiahong [mailto:[EMAIL PROTECTED] 
Sent: Wednesday, February 13, 2008 2:55 PM
To: Struts Users Mailing List
Subject: RE: [S2] : Help with annotated validation

That's indeed what I am missing. Thanks for your prompt help. 

-Original Message-
From: Dave Newton [mailto:[EMAIL PROTECTED] 
Sent: Wednesday, February 13, 2008 2:48 PM
To: Struts Users Mailing List
Subject: Re: [S2] : Help with annotated validation

--- Zheng, Xiahong [EMAIL PROTECTED] wrote:
 My annotated validation doesn't happen. The following are the code
 snippets for action class and config files. When I leave the SSN field
 blank and hit submit my action's execute method is called hence fails
 instead of redisplay of the login page again with validation error
 message. What am I missing here? 
 [...]
 action name=login class=my.pacakge.LoginAction
   resulthome/result
   result name=failedloginError/result
   interceptor-ref name=autowiring/
   interceptor-ref name=params/
   interceptor-ref name=validate/
   interceptor-ref name=workflow/
 /action

Do you have an input result defined?

If you have logging turned up you should see a reference to the
inability to
find an input result, which is where the workflow interceptor will
go to
when there are validation errors.

Dave


-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]


-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]


-- 
This message may contain confidential, proprietary, or legally privileged 
information. No confidentiality or privilege is waived by any transmission to 
an unintended recipient. If you are not an intended recipient, please notify 
the sender and delete this message immediately. Any views expressed in this 
message are those of the sender, not those of any entity within the KBC 
Financial Products group of companies (together referred to as KBC FP). 

This message does not create any obligation, contractual or otherwise, on the 
part of KBC FP. It is not an offer (or solicitation of an offer) of, or a 
recommendation to buy or sell, any financial product. Any prices or other 
values included in this message are indicative only, and do not necessarily 
represent current market prices, prices at which KBC FP would enter into a 
transaction, or prices at which similar transactions may be carried on KBC FP's 
own books. The information contained in this message is provided as is, 
without representations or warranties, express or implied, of any kind. Past 
performance is not indicative of future returns.


-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



RE: Logic tag library

2008-02-13 Thread Allen, Daniel
Keeping logic: tags actually renders perfectly well for me right now
(no exceptions, no apparent problems with the resulting page), but with
peculiar results for the actual logic it's supposed to be doing, so I
wasn't sure whether that was a configuration issue making it not
evaluate correctly, or a Struts1 configuration relic making it still
quasi-functional. I suppose the latter, then.

I didn't see the previous answer about MessagesPresent, but sometimes we
have brief e-mail outages here, so thanks for bearing with me (whether
that's our IT or just my fault).
~Dan



-Original Message-
From: Dave Newton [mailto:[EMAIL PROTECTED] 
Sent: Wednesday, February 13, 2008 3:36 PM
To: Struts Users Mailing List
Subject: Re: Logic tag library

--- Allen, Daniel [EMAIL PROTECTED] wrote:
 Is there any reason we shouldn't use the Logic tab library
 (http://struts.apache.org/tags-logic) with Struts 2? 

Because it won't work.

 If so, is there any subsitute?
 I'm looking specifically for logic:redirect and
 logic:messagesPresent (along with the old html: messages)

I thought I already answered the logic:messagesPresent.../ question:
expose
ActionSupport's ValidationAware stuff related to whether or not there
are
messages. AFAIK there is pre-built tag support for this, but it's a
simple
s:if... with exposed ValidationAware booleans.

W.r.t. html:messages/ see the s:actionerror.../ and
s:actionmessage.../
tags [1, 2]. The tag reference page [3] may also be of interest.

Not sure why the rest of the hijacked thread is still here; is it
related
somehow?

Dave

[1] http://struts.apache.org/2.x/docs/actionerror.html
[2] http://struts.apache.org/2.x/docs/actionmessage.html
[3] http://struts.apache.org/2.x/docs/tag-reference.html

-- 
This message may contain confidential, proprietary, or legally privileged 
information. No confidentiality or privilege is waived by any transmission to 
an unintended recipient. If you are not an intended recipient, please notify 
the sender and delete this message immediately. Any views expressed in this 
message are those of the sender, not those of any entity within the KBC 
Financial Products group of companies (together referred to as KBC FP). 

This message does not create any obligation, contractual or otherwise, on the 
part of KBC FP. It is not an offer (or solicitation of an offer) of, or a 
recommendation to buy or sell, any financial product. Any prices or other 
values included in this message are indicative only, and do not necessarily 
represent current market prices, prices at which KBC FP would enter into a 
transaction, or prices at which similar transactions may be carried on KBC FP's 
own books. The information contained in this message is provided as is, 
without representations or warranties, express or implied, of any kind. Past 
performance is not indicative of future returns.


-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Re: Logic tag library

2008-02-13 Thread Dave Newton
--- Allen, Daniel [EMAIL PROTECTED] wrote:
 Is there any reason we shouldn't use the Logic tab library
 (http://struts.apache.org/tags-logic) with Struts 2? 

Because it won't work.

 If so, is there any subsitute?
 I'm looking specifically for logic:redirect and
 logic:messagesPresent (along with the old html: messages)

I thought I already answered the logic:messagesPresent.../ question: expose
ActionSupport's ValidationAware stuff related to whether or not there are
messages. AFAIK there is pre-built tag support for this, but it's a simple
s:if... with exposed ValidationAware booleans.

W.r.t. html:messages/ see the s:actionerror.../ and s:actionmessage.../
tags [1, 2]. The tag reference page [3] may also be of interest.

Not sure why the rest of the hijacked thread is still here; is it related
somehow?

Dave

[1] http://struts.apache.org/2.x/docs/actionerror.html
[2] http://struts.apache.org/2.x/docs/actionmessage.html
[3] http://struts.apache.org/2.x/docs/tag-reference.html

 From: Zheng, Xiahong [mailto:[EMAIL PROTECTED] 
 Sent: Wednesday, February 13, 2008 2:55 PM
 To: Struts Users Mailing List
 Subject: RE: [S2] : Help with annotated validation
 
 That's indeed what I am missing. Thanks for your prompt help. 
 
 -Original Message-
 From: Dave Newton [mailto:[EMAIL PROTECTED] 
 Sent: Wednesday, February 13, 2008 2:48 PM
 To: Struts Users Mailing List
 Subject: Re: [S2] : Help with annotated validation
 
 --- Zheng, Xiahong [EMAIL PROTECTED] wrote:
  My annotated validation doesn't happen. The following are the code
  snippets for action class and config files. When I leave the SSN field
  blank and hit submit my action's execute method is called hence fails
  instead of redisplay of the login page again with validation error
  message. What am I missing here? 
  [...]
  action name=login class=my.pacakge.LoginAction
  resulthome/result
result name=failedloginError/result
  interceptor-ref name=autowiring/
interceptor-ref name=params/
interceptor-ref name=validate/
interceptor-ref name=workflow/
  /action
 
 Do you have an input result defined?
 
 If you have logging turned up you should see a reference to the
 inability to
 find an input result, which is where the workflow interceptor will
 go to
 when there are validation errors.
 
 Dave
 
 
 -
 To unsubscribe, e-mail: [EMAIL PROTECTED]
 For additional commands, e-mail: [EMAIL PROTECTED]
 
 
 -
 To unsubscribe, e-mail: [EMAIL PROTECTED]
 For additional commands, e-mail: [EMAIL PROTECTED]
 
 
 -- 
 This message may contain confidential, proprietary, or legally privileged
 information. No confidentiality or privilege is waived by any transmission
 to an unintended recipient. If you are not an intended recipient, please
 notify the sender and delete this message immediately. Any views expressed
 in this message are those of the sender, not those of any entity within the
 KBC Financial Products group of companies (together referred to as KBC
 FP). 
 
 This message does not create any obligation, contractual or otherwise, on
 the part of KBC FP. It is not an offer (or solicitation of an offer) of, or
 a recommendation to buy or sell, any financial product. Any prices or other
 values included in this message are indicative only, and do not necessarily
 represent current market prices, prices at which KBC FP would enter into a
 transaction, or prices at which similar transactions may be carried on KBC
 FP's own books. The information contained in this message is provided as
 is, without representations or warranties, express or implied, of any
 kind. Past performance is not indicative of future returns.
 
 
 -
 To unsubscribe, e-mail: [EMAIL PROTECTED]
 For additional commands, e-mail: [EMAIL PROTECTED]
 
 


-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



RE: Logic tag library

2008-02-13 Thread Dave Newton
--- Allen, Daniel [EMAIL PROTECTED] wrote:
 Keeping logic: tags actually renders perfectly well for me right now
 (no exceptions, no apparent problems with the resulting page), but with
 peculiar results for the actual logic it's supposed to be doing, so I
 wasn't sure whether that was a configuration issue making it not
 evaluate correctly, or a Struts1 configuration relic making it still
 quasi-functional. I suppose the latter, then.

Well, I suppose if you're using EL then the S2 request wrapper will still
look in the value stack for whatever the EL evaluates to... I sure wouldn't
rely on it working, though, and it seems kind of counter-intuitive since S1
and S2 are *completely* different.

Dave



-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



problems when using logic tag with jsp scriptlet

2007-05-05 Thread zhu zhiguo

I am using struts 1.2.8
in my jsp file, I wrote such codes:
logic:equal name=abean property=aproperty value=%=
Consts.PERSON_STATUS_YES%
some other codes...
/logic:equal 

when running on tomcat5.0, it is ok, but when I depoy it on another
middleware AS,I got an error:invalide tag lib using, I can only change
value to  a const like this:
logic:equal name=abean property=aproperty value1
some other codes...
/logic:equal 
it works.

I want to know is that this problem is caused by struts or that
middelware? though the AS is not well known,it passed the J2EE
standards 1.4 certification(it's name is Kingdee Apusic).

-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Re: problems when using logic tag with jsp scriptlet

2007-05-05 Thread zuzg

I'm sorry, the seconde code has some typing error, is should be:
logic:equal name=abean property=aproperty value=1
some other codes...
/logic:equal 




zuzg wrote:
 
 I am using struts 1.2.8
 in my jsp file, I wrote such codes:
 logic:equal name=abean property=aproperty value=%=
 Consts.PERSON_STATUS_YES%
 some other codes...
 /logic:equal 
 
 when running on tomcat5.0, it is ok, but when I depoy it on another
 middleware AS,I got an error:invalide tag lib using, I can only change
 value to  a const like this:
 logic:equal name=abean property=aproperty value1
 some other codes...
 /logic:equal 
 it works.
 
 I want to know is that this problem is caused by struts or that
 middelware? though the AS is not well known,it passed the J2EE
 standards 1.4 certification(it's name is Kingdee Apusic).
 
 -
 To unsubscribe, e-mail: [EMAIL PROTECTED]
 For additional commands, e-mail: [EMAIL PROTECTED]
 
 
 

-- 
View this message in context: 
http://www.nabble.com/problems-when-using-logic-tag-with-jsp-scriptlet-tf3695878.html#a10335091
Sent from the Struts - User mailing list archive at Nabble.com.


-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Re: problems when using logic tag with jsp scriptlet

2007-05-05 Thread Laurie Harper
Sounds like a problem with your application server. Runtime Expressions 
are handled by it, not by Struts, so I don't think this is a Struts issue.


L.

zuzg wrote:

I'm sorry, the seconde code has some typing error, is should be:
logic:equal name=abean property=aproperty value=1
some other codes...
/logic:equal 




zuzg wrote:

I am using struts 1.2.8
in my jsp file, I wrote such codes:
logic:equal name=abean property=aproperty value=%=
Consts.PERSON_STATUS_YES%
some other codes...
/logic:equal 

when running on tomcat5.0, it is ok, but when I depoy it on another
middleware AS,I got an error:invalide tag lib using, I can only change
value to  a const like this:
logic:equal name=abean property=aproperty value1
some other codes...
/logic:equal 
it works.

I want to know is that this problem is caused by struts or that
middelware? though the AS is not well known,it passed the J2EE
standards 1.4 certification(it's name is Kingdee Apusic).

-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]








-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Re: problems when using logic tag with jsp scriptlet

2007-05-05 Thread Jian Zhan
Hi Laurie,

Thanks for info and help. The problem looks rare. We
load the example coming with Struts
(struts-mailreader), it works, which use struts. That 
means application server is OK. The struts's logic,
bean, html and tiles works fine except action
servlet. We think there is only a little issue
somewhere block action loading when it starts, which
only applys to our application since other works
(struts-mailreader).

Thanks
Jian 
--- Laurie Harper [EMAIL PROTECTED] wrote:

 Sounds like a problem with your application server.
 Runtime Expressions 
 are handled by it, not by Struts, so I don't think
 this is a Struts issue.
 
 L.
 
 zuzg wrote:
  I'm sorry, the seconde code has some typing error,
 is should be:
  logic:equal name=abean property=aproperty
 value=1
  some other codes...
  /logic:equal 
  
  
  
  
  zuzg wrote:
  I am using struts 1.2.8
  in my jsp file, I wrote such codes:
  logic:equal name=abean property=aproperty
 value=%=
  Consts.PERSON_STATUS_YES%
  some other codes...
  /logic:equal 
 
  when running on tomcat5.0, it is ok, but when I
 depoy it on another
  middleware AS,I got an error:invalide tag lib
 using, I can only change
  value to  a const like this:
  logic:equal name=abean property=aproperty
 value1
  some other codes...
  /logic:equal 
  it works.
 
  I want to know is that this problem is caused by
 struts or that
  middelware? though the AS is not well known,it
 passed the J2EE
  standards 1.4 certification(it's name is Kingdee
 Apusic).
 
 

-
  To unsubscribe, e-mail:
 [EMAIL PROTECTED]
  For additional commands, e-mail:
 [EMAIL PROTECTED]
 
 
 
  
 
 

-
 To unsubscribe, e-mail:
 [EMAIL PROTECTED]
 For additional commands, e-mail:
 [EMAIL PROTECTED]
 
 




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

-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



DynaValidator and logic-tag

2007-03-27 Thread bjorn.de.bakker
Is there any way to show appropriate errors using DynaValidator?  

I have a form with 3 fields, one for the username and two fields for a 
password.  When you enter no values, a global error must be shown to the user.  
When the user enters an invalid character for the username, a messages that 
states that the user entered an invalid character should be shown in the web 
browser.  When he enters a username that is already taken, the browser should 
show that.  That also counts for the two password fields.  A message should be 
displayed when they are unequal or that they don't correspond to the rules (at 
least one number and special sign).

I created my Validator-class, but I really don't know how to accomplish the 
situation above.  Right now I'm drowning in a logic:messagesPresent and 
notPresent construction and if I have some sympathy for those who need to make 
some changes to this code, I'd have to replace it with a more clear and more 
understandable construction.  

Adding the whole validation-flow to one field is a solution, but I don't think 
that's a good one.  You stuff everything in 1 method and that's that.  Is there 
any other way to do this?

I have validation on 2 methods, username and password.  



This message is for the designated recipient only and may contain privileged, 
proprietary, or otherwise private information.  If you have received it in 
error, please notify the sender immediately and delete the original.  Any other 
use of the email by you is prohibited.


Re: Conditional Statements (if/else) Using logic tag

2006-05-15 Thread Jorge Martín Cuervo
Filter the List before sent to jsp, can you do it? or you must do it in
jsp?

you can implement your own custom tag extending iterate.


Other solution is to define a variable in jsp with c:set when you found
and item, and only print when variable isn't set or false.

Take a look to jstl common tags.


El dom, 14 de 05 de 2006 a las 18:49, J Gotsch escribió:

 I guess my problem is larger than using an if/else statement. I figured how 
 to do that, but I'm iterating over a List in the JSP, and want to be able to 
 exit the loop whenever certain item exist. I don't suppose there's a way to 
 do that, is there?

   My requirement in a nutshell: the List could have role1, role2, and role3. 
 But I can only print one role on the screen. If the list has multiple roles, 
 then my loop will show all of them. I want to be able to exit the loop after 
 I find the role that I'm looking for. 



   Philihp Busby [EMAIL PROTECTED] wrote:
   Jerome is referring to tags in the JSTL Core tag library.
 
 
 
 
 
 
 
 
 mmm code-bloat.
 
 On 5/14/06, J Gotsch wrote:
  Which package does this belong to? I can't find it anywhere.
 
  Jerome Gagner 
 wrote:
  use
 
  On 5/13/06, J Gotsch wrote:
   Hello All,
  
   How do I perform an If/else with ?
  
   In the below logic:iterate tag, If my collection contains both ROLE1 AND 
   ROLE2, Then both statements will be displayed. And that's now what I want.
  
   I want to implement something like this:
  
   if(securityRoleName.equals(ROLE1))
   // print You have ROLE1 !
   else if (securityRoleName.equals(ROLE1))
   //print You have ROLE2 !
   else
   //print you have NO ROLE!
  
   This is what I have now:
  
property=xyz scope=session
  
property=securityRoleName value=ROLE1
   You have ROLE1 !
  
property=securityRoleName value=ROLE2
   You have ROLE1 !
  
property=securityRoleName
   You have no ROLE!
  
  
  
  
  
   -
   Blab-away for as little as 1¢/min. Make PC-to-Phone Calls using Yahoo! 
   Messenger with Voice.
  
 
  -
  To unsubscribe, e-mail: [EMAIL PROTECTED]
  For additional commands, e-mail: [EMAIL PROTECTED]
 
 
 
 
  -
  Love cheap thrills? Enjoy PC-to-Phone calls to 30+ countries for just 
  2¢/min with Yahoo! Messenger with Voice.
 
 
 
   
 -
 Love cheap thrills? Enjoy PC-to-Phone  calls to 30+ countries for just 2¢/min 
 with Yahoo! Messenger with Voice.

-- 
;-)

Jorge Martin Cuervo
Analista Programador

Outsourcing Emarketplace
deFacto Powered by Standards

email [EMAIL PROTECTED]
voz +34 985 129 820
voz +34 660 026 384



Re: Conditional Statements (if/else) Using logic tag

2006-05-15 Thread Dave Newton
J Gotsch wrote:
 I guess my problem is larger than using an if/else statement.

This much is certainly true ;)

  I figured how to do that, but I'm iterating over a List in the JSP, and want 
 to be able to exit the loop whenever certain item exist. I don't suppose 
 there's a way to do that, is there?

   My requirement in a nutshell: the List could have role1, role2, and role3. 
 But I can only print one role on the screen. If the list has multiple roles, 
 then my loop will show all of them. I want to be able to exit the loop after 
 I find the role that I'm looking for. 
   

If you can only have one role on the screen why are you iterating at
all? Just use a sequence of if-thens, preferably using JSTL
c:choose... thingies.

Do you have an extensible list of possible roles?! If so I would
consider using a different mechanism than this; it will only lead to
tears. Perhaps an inclusion of a separate page, the name of which is
built using a known string concatenated with the role, etc.

Dave



-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Re: Conditional Statements (if/else) Using logic tag

2006-05-14 Thread Philihp Busby

Jerome is referring to tags in the JSTL Core tag library.

c:choose
c:when test=${conditional}
/c:when
c:otherwise
/c:otherwise
/c:choose

mmm code-bloat.

On 5/14/06, J Gotsch [EMAIL PROTECTED] wrote:

Which package does this belong to? I can't find it anywhere.

  Jerome Gagner [EMAIL PROTECTED] wrote:
  use

On 5/13/06, J Gotsch wrote:
 Hello All,

 How do I perform an If/else with ?

 In the below logic:iterate tag, If my collection contains both ROLE1 AND 
ROLE2, Then both statements will be displayed. And that's now what I want.

 I want to implement something like this:

 if(securityRoleName.equals(ROLE1))
 // print You have ROLE1 !
 else if (securityRoleName.equals(ROLE1))
 //print You have ROLE2 !
 else
 //print you have NO ROLE!

 This is what I have now:

  property=xyz scope=session

  property=securityRoleName value=ROLE1
 You have ROLE1 !

  property=securityRoleName value=ROLE2
 You have ROLE1 !

  property=securityRoleName
 You have no ROLE!





 -
 Blab-away for as little as 1¢/min. Make PC-to-Phone Calls using Yahoo! 
Messenger with Voice.


-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]




-
Love cheap thrills? Enjoy PC-to-Phone  calls to 30+ countries for just 2¢/min 
with Yahoo! Messenger with Voice.



Conditional Statements (if/else) Using logic tag

2006-05-13 Thread J Gotsch
Hello All,
   
  How do I perform an If/else with logic:iterate ?
   
  In the below logic:iterate tag, If my collection contains both ROLE1 AND 
ROLE2, Then both statements will be displayed. And that's now what I want. 
   
  I want to implement something like this:
   
  if(securityRoleName.equals(ROLE1)) 
// print You have ROLE1 !
  else if (securityRoleName.equals(ROLE1))
   //print You have ROLE2 !
  else 
   //print you have NO ROLE!
   
  This is what I have now:
   
  logic:iterate id=securityRoleTO name=abc   
property=xyzscope=session 
logic:present name=securityRoleTO 
  logic:match name=securityRoleTO 
property=securityRoleName value=ROLE1 
 You have ROLE1 !
  /logic:match 
  logic:match name=securityRoleTO
property=securityRoleName value=ROLE2 
 You have ROLE1 !
  /logic:match 
  logic:empty name=securityRoleTO
property=securityRoleName 
You have no ROLE!
  /logic:empty 
/logic:present 
  /logic:iterate 


-
Blab-away for as little as 1¢/min. Make  PC-to-Phone Calls using Yahoo! 
Messenger with Voice.

Re: Conditional Statements (if/else) Using logic tag

2006-05-13 Thread Jerome Gagner

use choose/when

On 5/13/06, J Gotsch [EMAIL PROTECTED] wrote:

Hello All,

  How do I perform an If/else with logic:iterate ?

  In the below logic:iterate tag, If my collection contains both ROLE1 AND 
ROLE2, Then both statements will be displayed. And that's now what I want.

  I want to implement something like this:

  if(securityRoleName.equals(ROLE1))
// print You have ROLE1 !
  else if (securityRoleName.equals(ROLE1))
   //print You have ROLE2 !
  else
   //print you have NO ROLE!

  This is what I have now:

  logic:iterate id=securityRoleTO name=abc
property=xyzscope=session
logic:present name=securityRoleTO
  logic:match name=securityRoleTO
property=securityRoleName value=ROLE1
 You have ROLE1 !
  /logic:match
  logic:match name=securityRoleTO
property=securityRoleName value=ROLE2
 You have ROLE1 !
  /logic:match
  logic:empty name=securityRoleTO
property=securityRoleName
You have no ROLE!
  /logic:empty
/logic:present
  /logic:iterate


-
Blab-away for as little as 1¢/min. Make  PC-to-Phone Calls using Yahoo! 
Messenger with Voice.



-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Re: Conditional Statements (if/else) Using logic tag

2006-05-13 Thread J Gotsch
Which package does this belong to? I can't find it anywhere.
   
  Jerome Gagner [EMAIL PROTECTED] wrote:
  use 

On 5/13/06, J Gotsch wrote:
 Hello All,

 How do I perform an If/else with ?

 In the below logic:iterate tag, If my collection contains both ROLE1 AND 
 ROLE2, Then both statements will be displayed. And that's now what I want.

 I want to implement something like this:

 if(securityRoleName.equals(ROLE1))
 // print You have ROLE1 !
 else if (securityRoleName.equals(ROLE1))
 //print You have ROLE2 !
 else
 //print you have NO ROLE!

 This is what I have now:

  property=xyz scope=session
 
  property=securityRoleName value=ROLE1
 You have ROLE1 !
 
  property=securityRoleName value=ROLE2
 You have ROLE1 !
 
  property=securityRoleName
 You have no ROLE!
 
 
 


 -
 Blab-away for as little as 1¢/min. Make PC-to-Phone Calls using Yahoo! 
 Messenger with Voice.


-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]




-
Love cheap thrills? Enjoy PC-to-Phone  calls to 30+ countries for just 2¢/min 
with Yahoo! Messenger with Voice.

using logic tag

2006-03-10 Thread temp temp
I am using struts 1.1
  
  I using logic equal tag  to check whether a page context attribute value.
  
  
  here is my code
  
  bean:define id=test value=0/
  logic:equal name=test value=0
 bean:define id=test1 value=2 /
  /logic:equal
  
  logic:equal name=test value=1
 bean:define id=test1 value=3 /
  /logic:equal
  
  So  only one logic equal will be true but not both .But when I call this 
jsp   in the browser I get  
  
  jsp exception  
  
  
  OracleJSP: oracle.jsp.parse.JspParseException: Line # 220, 
  bean:define id=test1 value=3 /
  Error: Tag attempted to define a bean which already exists: test1
  
  Why should I get this error when only one condition is true 
  
  
  Thanks  regards
  
  
  

-
Yahoo! Mail
Bring photos to life! New PhotoMail  makes sharing a breeze. 

RE: Logic Tag Question

2006-03-06 Thread Kalcevich, Daniel
Laurie,

I changed the code to be:

logic:iterate id=tz name=timezones
logic:equal name=accountProfileForm property=timeZone
value=${tz.value} 
bean:write name=tz property=label/
/logic:equal
/logic:iterate

Any it still does not write out the value that matches the
accountProfile.getTimeZone() field.  Any other ideas?

-Original Message-
From: news [mailto:[EMAIL PROTECTED] On Behalf Of Laurie Harper
Sent: Saturday, March 04, 2006 6:01 PM
To: user@struts.apache.org
Subject: Re: Logic Tag Question

Change ${tz}.value to ${tz.value}.

Kalcevich, Daniel wrote:
 The bean:write/ is fine.  I know that works.  The problem is with
the
 logic:equal comparion.  
 
 logic:iterate id=tz name=timezones
   logic:equal name=accountProfileForm property=timeZone
 value=${tz}.value
   bean:write name=tz property=label/
   /logic:equal
 /logic:iterate
 
 How can I say that the value I want to check against if the getValue()
 method from the tz variable?
 
 -Original Message-
 From: Michael Jouravlev [mailto:[EMAIL PROTECTED] 
 Sent: Friday, March 03, 2006 1:29 PM
 To: Struts Users Mailing List
 Subject: Re: Logic Tag Question
 
 On 3/3/06, Kalcevich, Daniel [EMAIL PROTECTED] wrote:
 bean:write name=tz property=label/
 But the problem is that the value that I want to compare in the
 logic:equal tag is really ${tz}.value.  But how can I set the value
to
 the getValue() from the tz variable.
 
 None of these works?
 
 bean:write name=tz.value property=label/
 bean:write name=tz property=value.label/
 bean:write name=tz.value.label/
 
 Michael.
 
 -
 To unsubscribe, e-mail: [EMAIL PROTECTED]
 For additional commands, e-mail: [EMAIL PROTECTED]


-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]


-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



RE: Logic Tag Question

2006-03-06 Thread Shasirekha Engala
is the timeZone membervariable of timeZones?

then replace the logic:equal tag with the following
logic:equal name=tz property=timeZone
value=${tz.value} 

-Original Message-
From: Kalcevich, Daniel [mailto:[EMAIL PROTECTED]
Sent: Monday, March 06, 2006 8:41 PM
To: Struts Users Mailing List
Subject: RE: Logic Tag Question


Laurie,

I changed the code to be:

logic:iterate id=tz name=timezones
logic:equal name=accountProfileForm property=timeZone
value=${tz.value} 
bean:write name=tz property=label/
/logic:equal
/logic:iterate

Any it still does not write out the value that matches the
accountProfile.getTimeZone() field.  Any other ideas?

-Original Message-
From: news [mailto:[EMAIL PROTECTED] On Behalf Of Laurie Harper
Sent: Saturday, March 04, 2006 6:01 PM
To: user@struts.apache.org
Subject: Re: Logic Tag Question

Change ${tz}.value to ${tz.value}.

Kalcevich, Daniel wrote:
 The bean:write/ is fine.  I know that works.  The problem is with
the
 logic:equal comparion.  
 
 logic:iterate id=tz name=timezones
   logic:equal name=accountProfileForm property=timeZone
 value=${tz}.value
   bean:write name=tz property=label/
   /logic:equal
 /logic:iterate
 
 How can I say that the value I want to check against if the getValue()
 method from the tz variable?
 
 -Original Message-
 From: Michael Jouravlev [mailto:[EMAIL PROTECTED] 
 Sent: Friday, March 03, 2006 1:29 PM
 To: Struts Users Mailing List
 Subject: Re: Logic Tag Question
 
 On 3/3/06, Kalcevich, Daniel [EMAIL PROTECTED] wrote:
 bean:write name=tz property=label/
 But the problem is that the value that I want to compare in the
 logic:equal tag is really ${tz}.value.  But how can I set the value
to
 the getValue() from the tz variable.
 
 None of these works?
 
 bean:write name=tz.value property=label/
 bean:write name=tz property=value.label/
 bean:write name=tz.value.label/
 
 Michael.
 
 -
 To unsubscribe, e-mail: [EMAIL PROTECTED]
 For additional commands, e-mail: [EMAIL PROTECTED]


-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]


-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]


-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Re: Logic Tag Question

2006-03-04 Thread Laurie Harper

Change ${tz}.value to ${tz.value}.

Kalcevich, Daniel wrote:

The bean:write/ is fine.  I know that works.  The problem is with the
logic:equal comparion.  


logic:iterate id=tz name=timezones
logic:equal name=accountProfileForm property=timeZone
value=${tz}.value
bean:write name=tz property=label/
/logic:equal
/logic:iterate

How can I say that the value I want to check against if the getValue()
method from the tz variable?

-Original Message-
From: Michael Jouravlev [mailto:[EMAIL PROTECTED] 
Sent: Friday, March 03, 2006 1:29 PM

To: Struts Users Mailing List
Subject: Re: Logic Tag Question

On 3/3/06, Kalcevich, Daniel [EMAIL PROTECTED] wrote:

bean:write name=tz property=label/
But the problem is that the value that I want to compare in the
logic:equal tag is really ${tz}.value.  But how can I set the value to
the getValue() from the tz variable.


None of these works?

bean:write name=tz.value property=label/
bean:write name=tz property=value.label/
bean:write name=tz.value.label/

Michael.

-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Logic Tag Question

2006-03-03 Thread Kalcevich, Daniel
I have the following:

 

-  An ArrayListLabelValueBean in the ServletContext called
timezones

-  A Form Bean in the request scope called accountProfileForm

 

I want to be able to loop through the values in the timezones
attribute and compate the value to the value of the timeZone in the
accountProfileForm.  Here is what I am trying:

 

logic:iterate id=timeZones collection=timezones property=value

  logic:equal name=accountProfileForm property=timeZone
value=timeZones.value

bean:write name=timeZones property=label/

  /logic:equal

/logic:iterate

 

I get the following error:

 

12:16:59,031 ERROR [action]:253 - Servlet.service() for servlet action
threw exception

javax.servlet.jsp.JspException: ServletException in
'/jsp/templates/tab_content_template.jsp': ServletException in
'/jsp/account/account_profile_form.jsp': Cannot create iterator for this
collection

  at
org.apache.struts.taglib.tiles.InsertTag$InsertHandler.doEndTag(InsertTa
g.java:923)

 

 

 

Can someone point me in the right direction or let me know what is wrong
with the above?  Thanks.

 

Daniel

 



Re: Logic Tag Question

2006-03-03 Thread Wendy Smoak
On 3/3/06, Kalcevich, Daniel [EMAIL PROTECTED] wrote:

I have the following:
 -  An ArrayListLabelValueBean in the ServletContext called
 timezones

 -  A Form Bean in the request scope called accountProfileForm

 I want to be able to loop through the values in the timezones
 attribute and compate the value to the value of the timeZone in the
 accountProfileForm.  Here is what I am trying:


It looks like a Map would be a better choice than an
ArrayListLabelValueBean.  Can you change it?  Then you could just use

[untested]
   c:out value=${timeZones[accountProfileForm.timeZone]}/

--
Wendy


Re: Logic Tag Question

2006-03-03 Thread [EMAIL PROTECTED]
If I am not mistaking you will use either the collection or the property
attribute but not both.
http://struts.apache.org/struts-taglib/tagreference-struts-logic.html#logic:iterate

For each iteration of the loop you should be able to compare the value of the
id property in you logic:equal tag to the forms value by saying
logic:iterate id=tz collection=timezones
  logic:equal name=accountProfileForm property=timeZone value=${tz}
//do something
  /logic:equal
/logic:iterate

Bryan LaPlante

-- Original Message ---
From: Kalcevich, Daniel [EMAIL PROTECTED]
To: user@struts.apache.org
Sent: Fri, 3 Mar 2006 12:21:18 -0800
Subject: Logic Tag Question

 I have the following:
 
 -  An ArrayListLabelValueBean in the ServletContext called
 timezones
 
 -  A Form Bean in the request scope called accountProfileForm
 
 I want to be able to loop through the values in the timezones
 attribute and compate the value to the value of the timeZone in the
 accountProfileForm.  Here is what I am trying:
 
 logic:iterate id=timeZones collection=timezones property=value
 
   logic:equal name=accountProfileForm property=timeZone
 value=timeZones.value
 
 bean:write name=timeZones property=label/
 
   /logic:equal
 
 /logic:iterate
 
 I get the following error:
 
 12:16:59,031 ERROR [action]:253 - Servlet.service() for servlet action
 threw exception
 
 javax.servlet.jsp.JspException: ServletException in
 '/jsp/templates/tab_content_template.jsp': ServletException in
 '/jsp/account/account_profile_form.jsp': Cannot create iterator for this
 collection
 
   at
 org.apache.struts.taglib.tiles.InsertTag$InsertHandler.doEndTag(InsertTa
 g.java:923)
 
 Can someone point me in the right direction or let me know what is wrong
 with the above?  Thanks.
 
 Daniel
--- End of Original Message ---

-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



RE: Logic Tag Question

2006-03-03 Thread Kalcevich, Daniel
OK, I am now able to get the iterate tag to work, but the comparison is
still not working.  I have this now:

logic:iterate id=tz name=timezones

logic:equal name=accountProfileForm property=timeZone
value=${tz}

bean:write name=tz property=label/

/logic:equal

/logic:iterate

But the problem is that the value that I want to compare in the
logic:equal tag is really ${tz}.value.  But how can I set the value to
the getValue() from the tz variable.

Daniel

-Original Message-
From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] 
Sent: Friday, March 03, 2006 12:52 PM
To: Struts Users Mailing List
Subject: Re: Logic Tag Question

If I am not mistaking you will use either the collection or the property
attribute but not both.
http://struts.apache.org/struts-taglib/tagreference-struts-logic.html#lo
gic:iterate

For each iteration of the loop you should be able to compare the value
of the
id property in you logic:equal tag to the forms value by saying
logic:iterate id=tz collection=timezones
  logic:equal name=accountProfileForm property=timeZone
value=${tz}
//do something
  /logic:equal
/logic:iterate

Bryan LaPlante

-- Original Message ---
From: Kalcevich, Daniel [EMAIL PROTECTED]
To: user@struts.apache.org
Sent: Fri, 3 Mar 2006 12:21:18 -0800
Subject: Logic Tag Question

 I have the following:
 
 -  An ArrayListLabelValueBean in the ServletContext called
 timezones
 
 -  A Form Bean in the request scope called
accountProfileForm
 
 I want to be able to loop through the values in the timezones
 attribute and compate the value to the value of the timeZone in
the
 accountProfileForm.  Here is what I am trying:
 
 logic:iterate id=timeZones collection=timezones property=value
 
   logic:equal name=accountProfileForm property=timeZone
 value=timeZones.value
 
 bean:write name=timeZones property=label/
 
   /logic:equal
 
 /logic:iterate
 
 I get the following error:
 
 12:16:59,031 ERROR [action]:253 - Servlet.service() for servlet action
 threw exception
 
 javax.servlet.jsp.JspException: ServletException in
 '/jsp/templates/tab_content_template.jsp': ServletException in
 '/jsp/account/account_profile_form.jsp': Cannot create iterator for
this
 collection
 
   at

org.apache.struts.taglib.tiles.InsertTag$InsertHandler.doEndTag(InsertTa
 g.java:923)
 
 Can someone point me in the right direction or let me know what is
wrong
 with the above?  Thanks.
 
 Daniel
--- End of Original Message ---

-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]


-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



RE: Logic Tag Question

2006-03-03 Thread [EMAIL PROTECTED]
wouldn't that be:
logic:equal name=accountProfileForm.timeZone property=value
value=${tz} 


Bryan LaPlante

-- Original Message ---
From: Kalcevich, Daniel [EMAIL PROTECTED]
To: Struts Users Mailing List user@struts.apache.org
Sent: Fri, 3 Mar 2006 13:17:02 -0800
Subject: RE: Logic Tag Question

 OK, I am now able to get the iterate tag to work, but the comparison is
 still not working.  I have this now:
 
 logic:iterate id=tz name=timezones
   
 logic:equal name=accountProfileForm property=timeZone
 value=${tz}
   
 bean:write name=tz property=label/
   
 /logic:equal
   
 /logic:iterate
 
 But the problem is that the value that I want to compare in the
 logic:equal tag is really ${tz}.value.  But how can I set the value to
 the getValue() from the tz variable.
 
 Daniel
 
 -Original Message-
 From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] 
 Sent: Friday, March 03, 2006 12:52 PM
 To: Struts Users Mailing List
 Subject: Re: Logic Tag Question
 
 If I am not mistaking you will use either the collection or the property
 attribute but not both.
 http://struts.apache.org/struts-taglib/tagreference-struts-logic.html#lo
 gic:iterate
 
 For each iteration of the loop you should be able to compare the value
 of the
 id property in you logic:equal tag to the forms value by saying
 logic:iterate id=tz collection=timezones
   logic:equal name=accountProfileForm property=timeZone
 value=${tz}
 //do something
   /logic:equal
 /logic:iterate
 
 Bryan LaPlante
 
 -- Original Message ---
 From: Kalcevich, Daniel [EMAIL PROTECTED]
 To: user@struts.apache.org
 Sent: Fri, 3 Mar 2006 12:21:18 -0800
 Subject: Logic Tag Question
 
  I have the following:
  
  -  An ArrayListLabelValueBean in the ServletContext called
  timezones
  
  -  A Form Bean in the request scope called
 accountProfileForm
  
  I want to be able to loop through the values in the timezones
  attribute and compate the value to the value of the timeZone in
 the
  accountProfileForm.  Here is what I am trying:
  
  logic:iterate id=timeZones collection=timezones property=value
  
logic:equal name=accountProfileForm property=timeZone
  value=timeZones.value
  
  bean:write name=timeZones property=label/
  
/logic:equal
  
  /logic:iterate
  
  I get the following error:
  
  12:16:59,031 ERROR [action]:253 - Servlet.service() for servlet action
  threw exception
  
  javax.servlet.jsp.JspException: ServletException in
  '/jsp/templates/tab_content_template.jsp': ServletException in
  '/jsp/account/account_profile_form.jsp': Cannot create iterator for
 this
  collection
  
at
 
 org.apache.struts.taglib.tiles.InsertTag$InsertHandler.doEndTag(InsertTa
  g.java:923)
  
  Can someone point me in the right direction or let me know what is
 wrong
  with the above?  Thanks.
  
  Daniel
 --- End of Original Message ---
 
 -
 To unsubscribe, e-mail: [EMAIL PROTECTED]
 For additional commands, e-mail: [EMAIL PROTECTED]
 
 -
 To unsubscribe, e-mail: [EMAIL PROTECTED]
 For additional commands, e-mail: [EMAIL PROTECTED]
--- End of Original Message ---


-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



RE: Logic Tag Question

2006-03-03 Thread Kalcevich, Daniel
The bean:write/ is fine.  I know that works.  The problem is with the
logic:equal comparion.  

logic:iterate id=tz name=timezones
logic:equal name=accountProfileForm property=timeZone
value=${tz}.value
bean:write name=tz property=label/
/logic:equal
/logic:iterate

How can I say that the value I want to check against if the getValue()
method from the tz variable?

-Original Message-
From: Michael Jouravlev [mailto:[EMAIL PROTECTED] 
Sent: Friday, March 03, 2006 1:29 PM
To: Struts Users Mailing List
Subject: Re: Logic Tag Question

On 3/3/06, Kalcevich, Daniel [EMAIL PROTECTED] wrote:
 bean:write name=tz property=label/
 But the problem is that the value that I want to compare in the
 logic:equal tag is really ${tz}.value.  But how can I set the value to
 the getValue() from the tz variable.

None of these works?

bean:write name=tz.value property=label/
bean:write name=tz property=value.label/
bean:write name=tz.value.label/

Michael.

-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]


-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Logic Tag Question

2006-02-10 Thread Kalcevich, Daniel
Everyone,

 

I have two modules defined (/  /app).  I want to use the logic tag
(either redirect or forward) to take me to the URL /myApp/index.htm
when I enter in just /myApp/.  I have defined an action within the /
module Struts Config File that is called /index and forwards to a
Tiles Definition.  

 

My question is, what syntax can I use on the index.jsp page at the root
of my site to forward to that URL?  Thanks.

 

daniel

 



Re: logic tag question about identifying a specific item in acollection

2005-10-01 Thread Mick Knutson
I am not having luck here.

I have a collection of cards (Card class)  that I am iterating through.
Then, I also have a form that has a cardValidatorForm (DynaForm).

cardForm.cardNumber is going to be equal to one of the card.cardNumber's
When I create the logic tag like you stated:
logic:equal property=cardNumber value=%= card.cardNumber %...

I get an error about missing a parameter/header/name

What am I missing?



Murray Collingwood wrote:

 Will the following work?

 html:form ...
 logic:iterate...through collection
  logic:equal property=foo value=bar
html:text ...display in form fields/
html:submit .../
  /logic:equal
  logic:notEqual property=foo value=bar
jsp:getProperty property=foo/
  /logic:notEqual
 /logic:iterate
 /html:form

 Kind regards
 mc


 On 29 Sep 2005 at 15:41, Mick Knutson wrote:

  I have a collection of cards. and I want to create a table fo thos
  cards, but if I get to a card where foo=bar, then I want to paint that
  row as a form with updateable fields and 1 submit for just that row.
  How would I do this please?
 
  --
 
  Thanks
  Mick Knutson
  (925) 951-4126
  HP Consulting Services
  Safeway (Blackhawk Fastword Project)
  J2EE Architect
  ---
 
 
 
  MMS safeway.com made the following annotations.
  --
  Warning:
  All e-mail sent to this address will be received by the Safeway corporate 
  e-mail
 system, and is subject to archival and review by someone other than the 
 recipient.  This
 e-mail may contain information proprietary to Safeway and is intended only 
 for the use
 of the intended recipient(s).  If the reader of this message is not the 
 intended
 recipient(s), you are notified that you have received this message in error 
 and that any
 review, dissemination, distribution or copying of this message is strictly 
 prohibited.  If
 you have received this message in error, please notify the sender immediately.
 
 
 =
 =
 
 
  -
  To unsubscribe, e-mail: [EMAIL PROTECTED]
  For additional commands, e-mail: [EMAIL PROTECTED]
 
 
 
  --
  No virus found in this incoming message.
  Checked by AVG Anti-Virus.
  Version: 7.0.344 / Virus Database: 267.11.9/115 - Release Date: 29/09/2005
 

 FOCUS Computing
 Mob: 0415 24 26 24
 [EMAIL PROTECTED]
 http://www.focus-computing.com.au

 --
 No virus found in this outgoing message.
 Checked by AVG Anti-Virus.
 Version: 7.0.344 / Virus Database: 267.11.9/115 - Release Date: 29/09/2005

 -
 To unsubscribe, e-mail: [EMAIL PROTECTED]
 For additional commands, e-mail: [EMAIL PROTECTED]

--

Thanks
Mick Knutson
(925) 951-4126
HP Consulting Services
Safeway (Blackhawk Fastword Project)
J2EE Architect
---



MMS safeway.com made the following annotations.
--
Warning: 
All e-mail sent to this address will be received by the Safeway corporate 
e-mail system, and is subject to archival and review by someone other than the 
recipient.  This e-mail may contain information proprietary to Safeway and is 
intended only for the use of the intended recipient(s).  If the reader of this 
message is not the intended recipient(s), you are notified that you have 
received this message in error and that any review, dissemination, distribution 
or copying of this message is strictly prohibited.  If you have received this 
message in error, please notify the sender immediately. 
  
==


-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Re: logic tag question about identifying a specific item in acollection

2005-10-01 Thread Kishore Senji
If you are using property on the logic:equal, you also have to supply the
name attribute. Define an id on the logic:iterate and use it as the
name on the logic:equal.

On 10/1/05, Mick Knutson [EMAIL PROTECTED] wrote:

 I am not having luck here.

 I have a collection of cards (Card class) that I am iterating through.
 Then, I also have a form that has a cardValidatorForm (DynaForm).

 cardForm.cardNumber is going to be equal to one of the card.cardNumber's
 When I create the logic tag like you stated:
 logic:equal property=cardNumber value=%= card.cardNumber %...

 I get an error about missing a parameter/header/name

 What am I missing?



 Murray Collingwood wrote:

  Will the following work?
 
  html:form ...
  logic:iterate...through collection
  logic:equal property=foo value=bar
  html:text ...display in form fields/
  html:submit .../
  /logic:equal
  logic:notEqual property=foo value=bar
  jsp:getProperty property=foo/
  /logic:notEqual
  /logic:iterate
  /html:form
 
  Kind regards
  mc
 
 
  On 29 Sep 2005 at 15:41, Mick Knutson wrote:
 
   I have a collection of cards. and I want to create a table fo thos
   cards, but if I get to a card where foo=bar, then I want to paint that
   row as a form with updateable fields and 1 submit for just that row.
   How would I do this please?
  
   --
  
   Thanks
   Mick Knutson
   (925) 951-4126
   HP Consulting Services
   Safeway (Blackhawk Fastword Project)
   J2EE Architect
   ---
  
  
  
   MMS safeway.com http://safeway.com made the following
 annotations.
  
 --
   Warning:
   All e-mail sent to this address will be received by the Safeway
 corporate e-mail
  system, and is subject to archival and review by someone other than the
 recipient. This
  e-mail may contain information proprietary to Safeway and is intended
 only for the use
  of the intended recipient(s). If the reader of this message is not the
 intended
  recipient(s), you are notified that you have received this message in
 error and that any
  review, dissemination, distribution or copying of this message is
 strictly prohibited. If
  you have received this message in error, please notify the sender
 immediately.
  
  
  =
  =
  
  
   -
   To unsubscribe, e-mail: [EMAIL PROTECTED]
   For additional commands, e-mail: [EMAIL PROTECTED]
  
  
  
   --
   No virus found in this incoming message.
   Checked by AVG Anti-Virus.
   Version: 7.0.344 / Virus Database: 267.11.9/115 - Release Date:
 29/09/2005
  
 
  FOCUS Computing
  Mob: 0415 24 26 24
  [EMAIL PROTECTED]
  http://www.focus-computing.com.au
 
  --
  No virus found in this outgoing message.
  Checked by AVG Anti-Virus.
  Version: 7.0.344 / Virus Database: 267.11.9/115 - Release Date:
 29/09/2005
 
  -
  To unsubscribe, e-mail: [EMAIL PROTECTED]
  For additional commands, e-mail: [EMAIL PROTECTED]

 --

 Thanks
 Mick Knutson
 (925) 951-4126
 HP Consulting Services
 Safeway (Blackhawk Fastword Project)
 J2EE Architect
 ---



 MMS safeway.com http://safeway.com made the following annotations.

 --
 Warning:
 All e-mail sent to this address will be received by the Safeway corporate
 e-mail system, and is subject to archival and review by someone other than
 the recipient. This e-mail may contain information proprietary to Safeway
 and is intended only for the use of the intended recipient(s). If the reader
 of this message is not the intended recipient(s), you are notified that you
 have received this message in error and that any review, dissemination,
 distribution or copying of this message is strictly prohibited. If you have
 received this message in error, please notify the sender immediately.


 ==


 -
 To unsubscribe, e-mail: [EMAIL PROTECTED]
 For additional commands, e-mail: [EMAIL PROTECTED]




Re: logic tag question about identifying a specific item in acollection

2005-10-01 Thread Murray Collingwood
Sounds like you need some documentation... try this:

http://struts.apache.org/userGuide/struts-logic.html

This tells you how to use those logic:... and html:... and bean:... tag 
libraries along 
with a few others.

Basically the use of the logic:iterate... tag should identify the attribute 
name of the 
collection and assign a new attribute name to be used for accessing each item 
within 
the collection.  

Inside the iteration you then access values from the current item using the 
newly 
assigned attribute name.  Next specify a property to retrieve the value from 
this item.

For example:

Collection stored in request has an attribute name of myCards, it is a type 
that 
implements Collection (maybe ArrayList or something).

logic:iterate name=myCards id=aCard

The collection of cards is now retrieved and the first card from the collection 
is now 
stored in some scope (maybe page) with the name aCard.  Within the confines 
of the 
logic:iterate begin and end tags I can now refer to this card in all my tags.

This card num is: jsp:getProperty name=aCard property=cardNumber/
logic:equal name=aCard property=cardNumber  value=7
 This is card number seven!
/logic:equal

/logic:iterate

Next question, where does the value come from that you are trying to test this 
card 
number against.   If %= card.cardNumber % going to retrieve the value are are 
wanting to test?  Can you tell us more about where this value is coming from?

Kind regards
mc



On 1 Oct 2005 at 14:45, Mick Knutson wrote:

 I am not having luck here.
 
 I have a collection of cards (Card class)  that I am iterating through.
 Then, I also have a form that has a cardValidatorForm (DynaForm).
 
 cardForm.cardNumber is going to be equal to one of the card.cardNumber's
 When I create the logic tag like you stated:
 logic:equal property=cardNumber value=%= card.cardNumber %...
 
 I get an error about missing a parameter/header/name
 
 What am I missing?
 
 
 
 Murray Collingwood wrote:
 
  Will the following work?
 
  html:form ...
  logic:iterate...through collection
   logic:equal property=foo value=bar
 html:text ...display in form fields/
 html:submit .../
   /logic:equal
   logic:notEqual property=foo value=bar
 jsp:getProperty property=foo/
   /logic:notEqual
  /logic:iterate
  /html:form
 
  Kind regards
  mc
 
 
  On 29 Sep 2005 at 15:41, Mick Knutson wrote:
 
   I have a collection of cards. and I want to create a table fo thos
   cards, but if I get to a card where foo=bar, then I want to paint that
   row as a form with updateable fields and 1 submit for just that row.
   How would I do this please?
  
   --
  
   Thanks
   Mick Knutson
   (925) 951-4126
   HP Consulting Services
   Safeway (Blackhawk Fastword Project)
   J2EE Architect
   ---
  
  
  
   MMS safeway.com made the following annotations.
   --
   Warning:
   All e-mail sent to this address will be received by the Safeway corporate 
   e-mail
  system, and is subject to archival and review by someone other than the 
  recipient.  
This
  e-mail may contain information proprietary to Safeway and is intended only 
  for the 
use
  of the intended recipient(s).  If the reader of this message is not the 
  intended
  recipient(s), you are notified that you have received this message in error 
  and that 
any
  review, dissemination, distribution or copying of this message is strictly 
  prohibited.  
If
  you have received this message in error, please notify the sender 
  immediately.
  
  
  
=
  =
  
  
   -
   To unsubscribe, e-mail: [EMAIL PROTECTED]
   For additional commands, e-mail: [EMAIL PROTECTED]
  
  
  
   --
   No virus found in this incoming message.
   Checked by AVG Anti-Virus.
   Version: 7.0.344 / Virus Database: 267.11.9/115 - Release Date: 29/09/2005
  
 
  FOCUS Computing
  Mob: 0415 24 26 24
  [EMAIL PROTECTED]
  http://www.focus-computing.com.au
 
  --
  No virus found in this outgoing message.
  Checked by AVG Anti-Virus.
  Version: 7.0.344 / Virus Database: 267.11.9/115 - Release Date: 29/09/2005
 
  -
  To unsubscribe, e-mail: [EMAIL PROTECTED]
  For additional commands, e-mail: [EMAIL PROTECTED]
 
 --
 
 Thanks
 Mick Knutson
 (925) 951-4126
 HP Consulting Services
 Safeway (Blackhawk Fastword Project)
 J2EE Architect
 ---
 
 
 
 MMS safeway.com made the following annotations.
 --
 Warning: 
 All e-mail sent to this address will be received by the Safeway corporate 
 e-mail 
system, and is subject to archival and review by someone other than the 
recipient.  This 
e-mail may contain information proprietary to Safeway and is intended only for 
the use 
of the intended recipient(s

logic tag question about identifying a specific item in a collection

2005-09-29 Thread Mick Knutson
I have a collection of cards. and I want to create a table fo thos
cards, but if I get to a card where foo=bar, then I want to paint that
row as a form with updateable fields and 1 submit for just that row.
How would I do this please?

--

Thanks
Mick Knutson
(925) 951-4126
HP Consulting Services
Safeway (Blackhawk Fastword Project)
J2EE Architect
---



MMS safeway.com made the following annotations.
--
Warning: 
All e-mail sent to this address will be received by the Safeway corporate 
e-mail system, and is subject to archival and review by someone other than the 
recipient.  This e-mail may contain information proprietary to Safeway and is 
intended only for the use of the intended recipient(s).  If the reader of this 
message is not the intended recipient(s), you are notified that you have 
received this message in error and that any review, dissemination, distribution 
or copying of this message is strictly prohibited.  If you have received this 
message in error, please notify the sender immediately. 
  
==


-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Re: logic tag question about identifying a specific item in a collection

2005-09-29 Thread Murray Collingwood
Will the following work?

html:form ...
logic:iterate...through collection
 logic:equal property=foo value=bar
   html:text ...display in form fields/
   html:submit .../
 /logic:equal
 logic:notEqual property=foo value=bar
   jsp:getProperty property=foo/
 /logic:notEqual
/logic:iterate
/html:form

Kind regards
mc
  

On 29 Sep 2005 at 15:41, Mick Knutson wrote:

 I have a collection of cards. and I want to create a table fo thos
 cards, but if I get to a card where foo=bar, then I want to paint that
 row as a form with updateable fields and 1 submit for just that row.
 How would I do this please?
 
 --
 
 Thanks
 Mick Knutson
 (925) 951-4126
 HP Consulting Services
 Safeway (Blackhawk Fastword Project)
 J2EE Architect
 ---
 
 
 
 MMS safeway.com made the following annotations.
 --
 Warning: 
 All e-mail sent to this address will be received by the Safeway corporate 
 e-mail 
system, and is subject to archival and review by someone other than the 
recipient.  This 
e-mail may contain information proprietary to Safeway and is intended only for 
the use 
of the intended recipient(s).  If the reader of this message is not the 
intended 
recipient(s), you are notified that you have received this message in error and 
that any 
review, dissemination, distribution or copying of this message is strictly 
prohibited.  If 
you have received this message in error, please notify the sender immediately. 
   
 
=
=
 
 
 -
 To unsubscribe, e-mail: [EMAIL PROTECTED]
 For additional commands, e-mail: [EMAIL PROTECTED]
 
 
 
 -- 
 No virus found in this incoming message.
 Checked by AVG Anti-Virus.
 Version: 7.0.344 / Virus Database: 267.11.9/115 - Release Date: 29/09/2005
 



FOCUS Computing
Mob: 0415 24 26 24
[EMAIL PROTECTED]
http://www.focus-computing.com.au



-- 
No virus found in this outgoing message.
Checked by AVG Anti-Virus.
Version: 7.0.344 / Virus Database: 267.11.9/115 - Release Date: 29/09/2005


-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Re: logic tag question about identifying a specific item in acollection

2005-09-29 Thread Mick Knutson
Thanks so much!

Murray Collingwood wrote:

 Will the following work?

 html:form ...
 logic:iterate...through collection
  logic:equal property=foo value=bar
html:text ...display in form fields/
html:submit .../
  /logic:equal
  logic:notEqual property=foo value=bar
jsp:getProperty property=foo/
  /logic:notEqual
 /logic:iterate
 /html:form

 Kind regards
 mc


 On 29 Sep 2005 at 15:41, Mick Knutson wrote:

  I have a collection of cards. and I want to create a table fo thos
  cards, but if I get to a card where foo=bar, then I want to paint that
  row as a form with updateable fields and 1 submit for just that row.
  How would I do this please?
 
  --
 
  Thanks
  Mick Knutson
  (925) 951-4126
  HP Consulting Services
  Safeway (Blackhawk Fastword Project)
  J2EE Architect
  ---
 
 
 
  MMS safeway.com made the following annotations.
  --
  Warning:
  All e-mail sent to this address will be received by the Safeway corporate 
  e-mail
 system, and is subject to archival and review by someone other than the 
 recipient.  This
 e-mail may contain information proprietary to Safeway and is intended only 
 for the use
 of the intended recipient(s).  If the reader of this message is not the 
 intended
 recipient(s), you are notified that you have received this message in error 
 and that any
 review, dissemination, distribution or copying of this message is strictly 
 prohibited.  If
 you have received this message in error, please notify the sender immediately.
 
 
 =
 =
 
 
  -
  To unsubscribe, e-mail: [EMAIL PROTECTED]
  For additional commands, e-mail: [EMAIL PROTECTED]
 
 
 
  --
  No virus found in this incoming message.
  Checked by AVG Anti-Virus.
  Version: 7.0.344 / Virus Database: 267.11.9/115 - Release Date: 29/09/2005
 

 FOCUS Computing
 Mob: 0415 24 26 24
 [EMAIL PROTECTED]
 http://www.focus-computing.com.au

 --
 No virus found in this outgoing message.
 Checked by AVG Anti-Virus.
 Version: 7.0.344 / Virus Database: 267.11.9/115 - Release Date: 29/09/2005

 -
 To unsubscribe, e-mail: [EMAIL PROTECTED]
 For additional commands, e-mail: [EMAIL PROTECTED]

--

Thanks
Mick Knutson
(925) 951-4126
HP Consulting Services
Safeway (Blackhawk Fastword Project)
J2EE Architect
---



MMS safeway.com made the following annotations.
--
Warning: 
All e-mail sent to this address will be received by the Safeway corporate 
e-mail system, and is subject to archival and review by someone other than the 
recipient.  This e-mail may contain information proprietary to Safeway and is 
intended only for the use of the intended recipient(s).  If the reader of this 
message is not the intended recipient(s), you are notified that you have 
received this message in error and that any review, dissemination, distribution 
or copying of this message is strictly prohibited.  If you have received this 
message in error, please notify the sender immediately. 
  
==


-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



logic tag - to check form elements

2005-09-28 Thread Raghu Kanchustambham
 I have a hidden html varibale called operation.
 html text=hidden name=operation /
  Now I want to conditionally display some buttons based on the value of
this hidden field. I am trying something like this...
 logic:equal name=${operation} value=update
 # display update related buttons
/logic
  This doesnt seem to work. What am I doing wrong? I know that if
'operation' was a variable is request/session then it would work fine. But
what should I do if operation is a html form element (hidden). I do not want
to write scriptlets.
 Thanks.
Best Regards,
Raghu


Re: logic tag - to check form elements

2005-09-28 Thread Michael Jouravlev
On 9/28/05, Raghu Kanchustambham [EMAIL PROTECTED] wrote:
  I have a hidden html varibale called operation.
  html text=hidden name=operation /

This defines a field in an HTML form, server knows nothing about it.

   Now I want to conditionally display some buttons based on the value of
 this hidden field. I am trying something like this...
  logic:equal name=${operation} value=update
  # display update related buttons
 /logic

This is evaluated on server before HTML page generated, browser knows
nothing about it.

 This doesnt seem to work.

JSTL hides the error, it does not blow up when it cannot find an object.

 What am I doing wrong? I know that if
 'operation' was a variable is request/session then it would work fine. But
 what should I do if operation is a html form element (hidden). I do not want
 to write scriptlets.

If you want to update HTML page without submitting it to the server,
then use some Javascript. If you submit form each time an operation is
changed, add an operation field to your form bean and use
logic:equal name=${myFormBean.operation} value=update
when you re-render the HTML page.

Michael.

-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Re: logic tag - to check form elements

2005-09-28 Thread Murray Collingwood
Hi Raghu

What's the name of the form bean?  Let's assume it's myformbean for the 
example:

html:hidden name=operation/

logic:equal name=myformbean property=operation value=update
...
/logic:equal

Use the 'name' parameter to reference the form bean name.  Use the 'property' 
parameter to reference the property.  Note, you will be testing the value in 
the form-
bean, not the value in the hidden html field.

Do you need to change the value of the hidden field?  If so you will need to 
use 
Javascript to perform this test and modify the displayed values.

Kind regards
mc


On 29 Sep 2005 at 1:03, Raghu Kanchustambham wrote:

  I have a hidden html varibale called operation.
  html text=hidden name=operation /
   Now I want to conditionally display some buttons based on the value of
 this hidden field. I am trying something like this...
  logic:equal name=${operation} value=update
  # display update related buttons
 /logic
   This doesnt seem to work. What am I doing wrong? I know that if
 'operation' was a variable is request/session then it would work fine. But
 what should I do if operation is a html form element (hidden). I do not want
 to write scriptlets.
  Thanks.
 Best Regards,
 Raghu
 



FOCUS Computing
Mob: 0415 24 26 24
[EMAIL PROTECTED]
http://www.focus-computing.com.au



-- 
No virus found in this outgoing message.
Checked by AVG Anti-Virus.
Version: 7.0.344 / Virus Database: 267.11.8/113 - Release Date: 27/09/2005


-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Re: Help with Struts-Logic Tag

2005-02-24 Thread Richard Reyes
Hi Tim/Guys,

the 2nd option is not working.

can you elaborate on the first one?

how do i declare the user? usebean?

thanks

Richard


On Tue, 22 Feb 2005 12:53:55 +, Tim Christopher
[EMAIL PROTECTED] wrote:
 Try using:
 
 logic:notPresent name=user 
logic:redirect href=routes-login.rr /
 /logic:notPresent
 
 Where user = Konstants.SESSION_USER_KEY, or maybe even:
 
 logic:notPresent name=% Konstants.SESSION_USER_KEY % 
 logic:redirect href=routes-login.rr /
 /logic:notPresent
 
 Tim Christopher
 
 On Tue, 22 Feb 2005 19:40:36 +0800, Richard Reyes
 [EMAIL PROTECTED] wrote:
  Hello Guys,
 
  I have this tag ...
 
  logic:notPresent name=hello.world logic:redirect
  href=routes-login.rr //logic:notPresent
 
  And I need to change hello.world to Konstants.HELLO_WORLD. Now this...
 
  logic:notPresent name=Konstants.SESSION_USER_KEY logic:redirect
  href=routes-login.rr //logic:notPresent
 
  does not seem to work( of course ).
 
  Please help. Thanks
 
  Richard
 
  -
  To unsubscribe, e-mail: [EMAIL PROTECTED]
  For additional commands, e-mail: [EMAIL PROTECTED]
 
 


-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Re: Help with Struts-Logic Tag

2005-02-24 Thread Tim Christopher
Sorry slight typo - try something of the form:

logic:present name=%=Konstants.SESSION_USER_KEY%
logic:redirect href=routes-login.rr /
/logic:present

Note the %= at the start of the name value.

If you look using Google you can problem find a simple tutorial to
explain all about the logic tags but put simply the above statement
checks for the presence of a bean named the value of
Konstants.SESSION_USER_KEY.  If this bean is present then it will
evaluate the nested content of the tag.

In most tutorials (I'd imagine) you'll see the value of the name
attribute will be something like user.  By using
%=Konstants.SESSION_USER_KEY% instead you're telling it to look up
this value.

Hope that helps you a bit.

Tim Christopher

On Thu, 24 Feb 2005 17:51:35 +0800, Richard Reyes
[EMAIL PROTECTED] wrote:
 Hi Tim/Guys,
 
 the 2nd option is not working.
 
 can you elaborate on the first one?
 
 how do i declare the user? usebean?
 
 thanks
 
 Richard
 
 
 On Tue, 22 Feb 2005 12:53:55 +, Tim Christopher
 [EMAIL PROTECTED] wrote:
  Try using:
 
  logic:notPresent name=user 
 logic:redirect href=routes-login.rr /
  /logic:notPresent
 
  Where user = Konstants.SESSION_USER_KEY, or maybe even:
 
  logic:notPresent name=% Konstants.SESSION_USER_KEY % 
  logic:redirect href=routes-login.rr /
  /logic:notPresent
 
  Tim Christopher
 
  On Tue, 22 Feb 2005 19:40:36 +0800, Richard Reyes
  [EMAIL PROTECTED] wrote:
   Hello Guys,
  
   I have this tag ...
  
   logic:notPresent name=hello.world logic:redirect
   href=routes-login.rr //logic:notPresent
  
   And I need to change hello.world to Konstants.HELLO_WORLD. Now this...
  
   logic:notPresent name=Konstants.SESSION_USER_KEY logic:redirect
   href=routes-login.rr //logic:notPresent
  
   does not seem to work( of course ).
  
   Please help. Thanks
  
   Richard
  
   -
   To unsubscribe, e-mail: [EMAIL PROTECTED]
   For additional commands, e-mail: [EMAIL PROTECTED]
  
  
 


-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



RE: Antwort: Clarrifications on Usage of logic tag library

2005-02-24 Thread Ashutosh Satyam
Hi,
 As suggeseted I switched to JSTL 1.0
I'm running my application using Tomcat 4.1.30.

Below is the content of my error page.

%@ taglib prefix=c uri=http://java.sun.com/jstl/core; %
%@ page language =java
import=java.util.*,javax.servlet.http.*
isErrorPage=true %

table cellSpacing=0 cellPadding=0 width=90% align=center
 tr
  td align=middle class=msg valign=center width=50%
   c:choose
   c:when test=${exception.class.name == 
'com.structs.InvalidParameterException'}
 Exception is InvalidParameterException.
   /c:when
   c:otherwise
 Exception is not InvalidParameterException.
   /c:otherwise
  /c:choose
  /td
 /tr
/table

If I'm not wrong 'exception' is an implicit object available to a JSP.
But I never see the when part of content getting printed even if 
InvalidParameterException
is thrown.

I also tried c:when test=${exception.getClass().getName() == 
'com.structs.InvalidParameterException'}
But this time it encountered some parsing error.

How exactly an object instance is passed to a JSTL tag? I'm not very clear on 
that.
Let me know where I'm doing wrong.

Regards,
Ashutosh


-Original Message-
From: Joe Germuska [mailto:[EMAIL PROTECTED]
Sent: Wednesday, February 23, 2005 4:51 PM
To: Karsten Krieg; Struts Users Mailing List
Subject: Re: Antwort: Clarrifications on Usage of logic tag library


At 11:40 AM +0100 2/23/05, Karsten Krieg wrote:
Hi!

It's been suggested to not continue using the Struts own tag libraries and
instead move on to the JSTL. With them, I'd construct the following for
your scenario:

while this is a good general suggestion, neither tag library makes it 
easy to deal with the class of an exception.  I suppose technically 
you could use bean properties to test against the string form of an 
exceptions' class name:
c:if test=${ex.class.name == 'java.lang.IllegalStateException'}../c:if

but you might simply find Struts' own declarative exception handling 
to be a more straightforward way to deal with this...

Joe


%@ taglib prefix=c uri=http://java.sun.com/jstl/core; %

c:choose
   c:when test=${exception1}
 your content
   /c:when
   c:when test=${exception2}
 your content
   /c:when
/c:choose

You can nest the c:when and c:choose, so AND and OR constructs are
possible.

With regards
Karsten Krieg
intarsys consulting GmbH

Fon +49 (0)721 3 84 79 - 28
Fax +49 (0)721 3 84 79 - 60
e-mail [EMAIL PROTECTED]
http://www.intarsys.de


Ashutosh Satyam [EMAIL PROTECTED] schrieb am 23.02.2005 11:19:48:

  Hi,
   Can you suggest how to use the logic tag library to achieve the
  following scenario.

  - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
  - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -

   In my Action class I expect few Exceptions to be thrown. Incase if
  any exception
   is throw it's always redirected to a common 'error.jsp' page.

   In this page I wanted to use 'logic' taglibrary to present a
  different content in the
   page based on the Exception thrown.

   Something like -
if( Exception1) {
  some html contents
  } else if(Exception2) {
  some html contents
  } else {
 some html contents
  }

  Also how do we achieve logical AND and logical OR condtion using
  logic tag library

  - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
  - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -

   I hope we can use the logic taglibrary in the scenario what I
  pointed out. An example
   for the same would suffice my requirement.

  Regards,
  Ashutosh






-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]


-- 
Joe Germuska
[EMAIL PROTECTED]  
http://blog.germuska.com
Narrow minds are weapons made for mass destruction  -The Ex

-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]


-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



RE: Antwort: Clarrifications on Usage of logic tag library

2005-02-24 Thread Kris Schneider
Quoting Ashutosh Satyam [EMAIL PROTECTED]:

 Hi,
  As suggeseted I switched to JSTL 1.0
 I'm running my application using Tomcat 4.1.30.
 
 Below is the content of my error page.
 
 %@ taglib prefix=c uri=http://java.sun.com/jstl/core; %
 %@ page language =java
 import=java.util.*,javax.servlet.http.*
 isErrorPage=true %
 
 table cellSpacing=0 cellPadding=0 width=90% align=center
  tr
   td align=middle class=msg valign=center width=50%
c:choose
c:when test=${exception.class.name ==
 'com.structs.InvalidParameterException'}
  Exception is InvalidParameterException.
/c:when
c:otherwise
  Exception is not InvalidParameterException.
/c:otherwise
   /c:choose
   /td
  /tr
 /table
 
 If I'm not wrong 'exception' is an implicit object available to a JSP.
 But I never see the when part of content getting printed even if
 InvalidParameterException
 is thrown.

For an error page, exception is an implicit *scripting* variable. Meaning it's
available to scriptlets (% %) and scripting expressions (%= %). It is not
an implicit JSTL/EL object. However, there are a number of request attributes
that should be set by the container. Here's how you might get at them with
JSTL:

%@ page isErrorPage=true contentType=text/plain %
%@ taglib prefix=c uri=http://java.sun.com/jstl/core; %

Error Page:
---
status_code:c:out
value=${requestScope['javax.servlet.error.status_code']}/
exception_type: c:out
value=${requestScope['javax.servlet.error.exception_type']}/
message:c:out value=${requestScope['javax.servlet.error.message']}/
exception:  c:out
value=${requestScope['javax.servlet.error.exception']}/
request_uri:c:out
value=${requestScope['javax.servlet.error.request_uri']}/
servlet_name:   c:out
value=${requestScope['javax.servlet.error.servlet_name']}/

See the servlet spec for details...

 I also tried c:when test=${exception.getClass().getName() ==
 'com.structs.InvalidParameterException'}
 But this time it encountered some parsing error.
 
 How exactly an object instance is passed to a JSTL tag? I'm not very clear on
 that.
 Let me know where I'm doing wrong.
 
 Regards,
 Ashutosh
 
 
 -Original Message-
 From: Joe Germuska [mailto:[EMAIL PROTECTED]
 Sent: Wednesday, February 23, 2005 4:51 PM
 To: Karsten Krieg; Struts Users Mailing List
 Subject: Re: Antwort: Clarrifications on Usage of logic tag library
 
 
 At 11:40 AM +0100 2/23/05, Karsten Krieg wrote:
 Hi!
 
 It's been suggested to not continue using the Struts own tag libraries and
 instead move on to the JSTL. With them, I'd construct the following for
 your scenario:
 
 while this is a good general suggestion, neither tag library makes it 
 easy to deal with the class of an exception.  I suppose technically 
 you could use bean properties to test against the string form of an 
 exceptions' class name:
 c:if test=${ex.class.name == 'java.lang.IllegalStateException'}../c:if
 
 but you might simply find Struts' own declarative exception handling 
 to be a more straightforward way to deal with this...
 
 Joe
 
 
 %@ taglib prefix=c uri=http://java.sun.com/jstl/core; %
 
 c:choose
c:when test=${exception1}
  your content
/c:when
c:when test=${exception2}
  your content
/c:when
 /c:choose
 
 You can nest the c:when and c:choose, so AND and OR constructs are
 possible.
 
 With regards
 Karsten Krieg
 intarsys consulting GmbH
 
 Fon +49 (0)721 3 84 79 - 28
 Fax +49 (0)721 3 84 79 - 60
 e-mail [EMAIL PROTECTED]
 http://www.intarsys.de
 
 
 Ashutosh Satyam [EMAIL PROTECTED] schrieb am 23.02.2005 11:19:48:
 
   Hi,
Can you suggest how to use the logic tag library to achieve the
   following scenario.
 
   - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
   - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
 
In my Action class I expect few Exceptions to be thrown. Incase if
   any exception
is throw it's always redirected to a common 'error.jsp' page.
 
In this page I wanted to use 'logic' taglibrary to present a
   different content in the
page based on the Exception thrown.
 
Something like -
 if( Exception1) {
   some html contents
   } else if(Exception2) {
   some html contents
   } else {
  some html contents
   }
 
   Also how do we achieve logical AND and logical OR condtion using
   logic tag library
 
   - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
   - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
 
I hope we can use the logic taglibrary in the scenario what I
   pointed out. An example
for the same would suffice my requirement.
 
   Regards,
   Ashutosh
 
 
 
 
 
 
 -
 To unsubscribe, e-mail: [EMAIL PROTECTED]
 For additional commands, e-mail: [EMAIL PROTECTED

Clarrifications on Usage of logic tag library

2005-02-23 Thread Ashutosh Satyam
Hi,
 Can you suggest how to use the logic tag library to achieve the following 
scenario.
 
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - 
- - - - - - - - - - - - - - - - - - - - - - - - - - - -

 In my Action class I expect few Exceptions to be thrown. Incase if any 
exception 
 is throw it's always redirected to a common 'error.jsp' page.

 In this page I wanted to use 'logic' taglibrary to present a different content 
in the 
 page based on the Exception thrown.
 
 Something like - 
  if( Exception1) {
some html contents
} else if(Exception2) {
some html contents
} else {
   some html contents
}
 
Also how do we achieve logical AND and logical OR condtion using logic tag 
library

- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - 
- - - - - - - - - - - - - - - - - - - - - - - - - - - -

 I hope we can use the logic taglibrary in the scenario what I pointed out. An 
example 
 for the same would suffice my requirement.

Regards,
Ashutosh




Antwort: Clarrifications on Usage of logic tag library

2005-02-23 Thread Karsten Krieg

Hi!

It's been suggested to not continue using the Struts own tag libraries and
instead move on to the JSTL. With them, I'd construct the following for
your scenario:

%@ taglib prefix=c uri=http://java.sun.com/jstl/core; %

c:choose
  c:when test=${exception1}
your content
  /c:when
  c:when test=${exception2}
your content
  /c:when
/c:choose

You can nest the c:when and c:choose, so AND and OR constructs are
possible.

With regards
Karsten Krieg
intarsys consulting GmbH

Fon +49 (0)721 3 84 79 - 28
Fax +49 (0)721 3 84 79 - 60
e-mail [EMAIL PROTECTED]
http://www.intarsys.de


Ashutosh Satyam [EMAIL PROTECTED] schrieb am 23.02.2005 11:19:48:

 Hi,
  Can you suggest how to use the logic tag library to achieve the
 following scenario.

 - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
 - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -

  In my Action class I expect few Exceptions to be thrown. Incase if
 any exception
  is throw it's always redirected to a common 'error.jsp' page.

  In this page I wanted to use 'logic' taglibrary to present a
 different content in the
  page based on the Exception thrown.

  Something like -
   if( Exception1) {
 some html contents
 } else if(Exception2) {
 some html contents
 } else {
some html contents
 }

 Also how do we achieve logical AND and logical OR condtion using
 logic tag library

 - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
 - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -

  I hope we can use the logic taglibrary in the scenario what I
 pointed out. An example
  for the same would suffice my requirement.

 Regards,
 Ashutosh






-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Re: Antwort: Clarrifications on Usage of logic tag library

2005-02-23 Thread Joe Germuska
At 11:40 AM +0100 2/23/05, Karsten Krieg wrote:
Hi!
It's been suggested to not continue using the Struts own tag libraries and
instead move on to the JSTL. With them, I'd construct the following for
your scenario:
while this is a good general suggestion, neither tag library makes it 
easy to deal with the class of an exception.  I suppose technically 
you could use bean properties to test against the string form of an 
exceptions' class name:
c:if test=${ex.class.name == 'java.lang.IllegalStateException'}../c:if

but you might simply find Struts' own declarative exception handling 
to be a more straightforward way to deal with this...

Joe

%@ taglib prefix=c uri=http://java.sun.com/jstl/core; %
c:choose
  c:when test=${exception1}
your content
  /c:when
  c:when test=${exception2}
your content
  /c:when
/c:choose
You can nest the c:when and c:choose, so AND and OR constructs are
possible.
With regards
Karsten Krieg
intarsys consulting GmbH

Fon +49 (0)721 3 84 79 - 28
Fax +49 (0)721 3 84 79 - 60
e-mail [EMAIL PROTECTED]
http://www.intarsys.de

Ashutosh Satyam [EMAIL PROTECTED] schrieb am 23.02.2005 11:19:48:
 Hi,
  Can you suggest how to use the logic tag library to achieve the
 following scenario.
 - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
 - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
  In my Action class I expect few Exceptions to be thrown. Incase if
 any exception
  is throw it's always redirected to a common 'error.jsp' page.
  In this page I wanted to use 'logic' taglibrary to present a
 different content in the
  page based on the Exception thrown.
  Something like -
   if( Exception1) {
 some html contents
 } else if(Exception2) {
 some html contents
 } else {
some html contents
 }
 Also how do we achieve logical AND and logical OR condtion using
 logic tag library
 - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
 - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
  I hope we can use the logic taglibrary in the scenario what I
 pointed out. An example
  for the same would suffice my requirement.
 Regards,
 Ashutosh



-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

--
Joe Germuska
[EMAIL PROTECTED]  
http://blog.germuska.com
Narrow minds are weapons made for mass destruction  -The Ex

-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]


Help with Struts-Logic Tag

2005-02-22 Thread Richard Reyes
Hello Guys,

I have this tag ...

logic:notPresent name=hello.world logic:redirect
href=routes-login.rr //logic:notPresent

And I need to change hello.world to Konstants.HELLO_WORLD. Now this...

logic:notPresent name=Konstants.SESSION_USER_KEY logic:redirect
href=routes-login.rr //logic:notPresent

does not seem to work( of course ). 

Please help. Thanks

Richard

-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Re: Help with Struts-Logic Tag

2005-02-22 Thread Tim Christopher
Try using:

logic:notPresent name=user 
   logic:redirect href=routes-login.rr /
/logic:notPresent

Where user = Konstants.SESSION_USER_KEY, or maybe even:

logic:notPresent name=% Konstants.SESSION_USER_KEY % 
logic:redirect href=routes-login.rr /
/logic:notPresent

Tim Christopher

On Tue, 22 Feb 2005 19:40:36 +0800, Richard Reyes
[EMAIL PROTECTED] wrote:
 Hello Guys,
 
 I have this tag ...
 
 logic:notPresent name=hello.world logic:redirect
 href=routes-login.rr //logic:notPresent
 
 And I need to change hello.world to Konstants.HELLO_WORLD. Now this...
 
 logic:notPresent name=Konstants.SESSION_USER_KEY logic:redirect
 href=routes-login.rr //logic:notPresent
 
 does not seem to work( of course ).
 
 Please help. Thanks
 
 Richard
 
 -
 To unsubscribe, e-mail: [EMAIL PROTECTED]
 For additional commands, e-mail: [EMAIL PROTECTED]
 


-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Re: about logic tag

2004-12-13 Thread Pramod
I have done the steps but i didn't get results

-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



logic tag

2004-12-13 Thread Pramod
I am having a vector object in jsp. An ActionForm's two instances are stored in 
that vector. Action form contains only one variable. How can i produce the 
results using logic  bean tags

Re: about logic tag

2004-12-13 Thread Andrew Hill
Are there stairs in your house?
Pramod wrote:
I have done the steps but i didn't get results
-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]


-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]


Re: about logic tag

2004-12-13 Thread Pramod
i didnt get u

-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Re: logic tag

2004-12-13 Thread Andrew Hill
Sorry mate, you going to have to be a bit more specific about the 
problems your having, and precisely what result it is that you are 
actually trying to achieve, as we are having some trouble understanding 
the question!

snip
I am having a vector object in jsp
/snip
In a request or session attribute I presume?
snip
An ActionForm's two instances are stored in that vector
/snip
This I dont understand. The struts methodology involves one actionform 
per request, and its instantiated, populated and put into the request 
)or session) by the RequestProcessor. Are you doing some custom handling 
to support multiple actionforms per request or did you mean something else?

snip
How can i produce the results
/snip
What is the result that you are trying to produce?
I guess you want to iterate a vector and output the contents?
At its simplest you should be able to do something like:
logic:iterate name=myVector id=myBean
  bean:write name=myBean property=myProperty
  br/
/logic:iterate
Change myVector to the attribute key that your vector is stored under 
in the request or session. myProperty refers to the name of the single 
variable you wish to output. It needs to have a single getMyProperty() 
method (change names as appropriate).

hth
Andrew
ps:
The article at:
http://www.catb.org/~esr/faqs/smart-questions.html
has some advise on how to improve your communication when asking 
questions in lists like this, and is well worth a read if you are new to 
such forums.


Pramod wrote:
I am having a vector object in jsp. An ActionForm's two instances are stored in that vector. Action form contains only one variable. How can i produce the results using logic  bean tags

-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]


Re: about logic tag

2004-12-13 Thread Andrew Hill
opps. Didnt see this post when I replied just now.
The syntax seems ok. When you say its not producing results, is there 
any error message or stack trace, or is it just that that part of the 
page is blank?

If blank it sounds like the results vector is empty. I presume you 
initialise it in your Action before forwarding to the view? Given that 
you say the actionform is being recreated I rather suspect that you may 
inadvertanly be using a redirecting forward to forward to the JSP. Check 
your struts-config.xml and make sure that the ActionForward pointing to 
the JSP has redirect=false set.

Also check that your action=... path in the html:form tag is correct 
and points at the right action.

Pramod wrote:
It is not displaying the results. The code producing new instances of
ActionForm.
i will send my code
logic:iterate id=advanceEntryForm name=results
   tr
td bgcolor=beigebean:write property=resid name=advanceEntryForm
/
   /tr
  /logic:iterate

-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]


-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]


Re: about logic tag

2004-12-13 Thread Pramod
This is the code in the model class's method
if(result!=null || result.size()0)
 {
  objectVector = new Vector();
for(int i=0;iresult.size();i++)
{
 try
 {
  Hashtable hsTable = new Hashtable();
  hsTable = (Hashtable)result.elementAt(i);
  AdvanceEntryForm advanceEntryForm = new AdvanceEntryForm();
  advanceEntryForm.setResId((String)hsTable.get(resid)); 
  
objectVector.add(advanceEntryForm);
 

 }
 catch(NullPointerException ne)
 {
  continue; 
 }
 
}
  }

The variable objectVector is returned as collection of formbeans. 

In action

Vector results =  beanObject.getMethod();
request.setAttribute(results,results);


Still i can't the print the values in collection object

-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Re: about logic tag

2004-12-13 Thread Webmaster
Pramod (et al)

Please refer to the Guidelines for Struts Mailing List for further posts
http://struts.apache.org/mail.html

Martin Gainty

-Original message-
From: Andrew Hill [EMAIL PROTECTED]
Date: Mon, 13 Dec 2004 06:15:33 -0500
To: Struts Users Mailing List [EMAIL PROTECTED]
Subject: Re: about logic tag

 Are there stairs in your house?
 
 Pramod wrote:
 
  I have done the steps but i didn't get results
  
  -
  To unsubscribe, e-mail: [EMAIL PROTECTED]
  For additional commands, e-mail: [EMAIL PROTECTED]
  
  
 
 
 -
 To unsubscribe, e-mail: [EMAIL PROTECTED]
 For additional commands, e-mail: [EMAIL PROTECTED]
 


This message and its contents are intended for receiver. Information contained 
within is protected by Law. If you have received this message in error please 
delete it and notify [EMAIL PROTECTED]



-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



about logic tag

2004-12-12 Thread Pramod
I have a vector object in a jsp page. An ActionForm's two instances  
are stored in that vector. How can i display the values using bean  logic tag?

Re: about logic tag

2004-12-12 Thread Sunny
logic:iterate id = actionForm name = vector
 !-- for each iteration you have reference to current element in 
vector to actionForm. use it. --
bean:write property =class name = actionForm/ 
!-- write runtime class of actionForm to jsp. equivalant of  
out.println(actionForm.getClass()); --
/logic:iterate

Pramod wrote:
   I have a vector object in a jsp page. An ActionForm's two instances  are stored in that vector. How can i display the values using bean  logic tag?
 

-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]


Re: about logic tag

2004-12-12 Thread Pramod
It is not displaying the results. The code producing new instances of
ActionForm.

i will send my code

logic:iterate id=advanceEntryForm name=results
   tr
td bgcolor=beigebean:write property=resid name=advanceEntryForm
/
   /tr
  /logic:iterate



-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Re: about logic tag

2004-12-12 Thread Pramod
I can't produce the result. The bean tag creating new instance of
ActionForm.Get me a solution.


-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



logic tag

2004-12-10 Thread Pramod
I have a bean object in the jsp page. How can i use the logic:iterate tag to 
producing the result?

Re: logic tag

2004-12-10 Thread Sunny
Pramod wrote:
I have a bean object in the jsp page. How can i use the logic:iterate tag to producing the result?
 

If the bean has a Collection say collection , you can do
logic:iterate id = element name = bean property = collection
!-- here you can refer to each element in collection using element --
/logic:iterate
note: you should have a getter method for collection in the bean, 
for e.g. getCollection()



-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Logic tag to JSTL

2004-11-10 Thread TroyGeek
How would I turn the following logic tag into a JSTL tag. Would it use
the core tags?

logic:iterate id=yourProjects name=projectList
bean:write name=yourProjects property=projectId/
bean:write name=yourProjects property=projectName/
/logic:iterate

thank you!

Troyston Campano

-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



RE: Logic tag to JSTL

2004-11-10 Thread Slattery, Tim - BLS
 How would I turn the following logic tag into a JSTL tag. 
 
 logic:iterate id=yourProjects name=projectList
   bean:write name=yourProjects property=projectId/
   bean:write name=yourProjects 
 property=projectName/ /logic:iterate

c:forEach items=${projectList} var=yourProjects
   c:out value=${yourProjects.projectId}/
   c:out value=${yourProjects.projectName}/
/c:forEach

--
Tim Slattery
[EMAIL PROTECTED]


-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Re: Logic tag to JSTL

2004-11-10 Thread Erik Weber
c:forEach items='myCollection' var='currentItem'
c:out value=${currentItem.someProperty}/
/c:forEach
Erik

TroyGeek wrote:
How would I turn the following logic tag into a JSTL tag. Would it use
the core tags?
logic:iterate id=yourProjects name=projectList
bean:write name=yourProjects property=projectId/
bean:write name=yourProjects property=projectName/
/logic:iterate
thank you!
Troyston Campano
-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
 

-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]


FW: property element in logic tag

2004-10-21 Thread Suzy Fynes
 
Hi,
 
Can anyone see why the following will would not work
 
logic-el:match name=PersonStatus
property=person.countryCode.countryCode
value=${CountryCode.countryCode}
 
PersonStatus is a session object that contains a nested object
countryCode of type CountryCode and the class CountryCode contains a
string m_countryCode.
 
There is also a session object CountryCode that is an arraylist of
different country codes e.g. UK is United Kingdom, IE is Ireland etc
 
I tried using  bean:write =PersonStatus
property=person.countryCode.countryCode and kept getting the error
Null property value for 'countryCode', but I've done system.out checks
and the object is set with values.
 
Thanks
Suzy


Re: FW: property element in logic tag

2004-10-21 Thread Jeff Beal
I think you have a few extra layers of nesting.  What exactly are your 
system.out checks?  What's being called in  the custom tags is the same as

session.getAttribute(PersonStatus).getPerson().getCountryCode().getCountryCode()
The value portion of the logic-el/ tag is
session.getAttribute(CountryCode).getCountryCode()
See if that's what you want to be called.  Based on your description, it 
seems like the person. is irrelevant and the second 'countryCode' may 
need to be 'm_countryCode'

-- Jeff
Suzy Fynes wrote:
 
Hi,
 
Can anyone see why the following will would not work
 
logic-el:match name=PersonStatus
property=person.countryCode.countryCode
value=${CountryCode.countryCode}
 
PersonStatus is a session object that contains a nested object
countryCode of type CountryCode and the class CountryCode contains a
string m_countryCode.
 
There is also a session object CountryCode that is an arraylist of
different country codes e.g. UK is United Kingdom, IE is Ireland etc
 
I tried using  bean:write =PersonStatus
property=person.countryCode.countryCode and kept getting the error
Null property value for 'countryCode', but I've done system.out checks
and the object is set with values.
 
Thanks
Suzy


-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]


nested logic tag

2004-05-13 Thread Kathy Zhou
I need your help on how to use nested logic tag:

I have a ArrayList list1. each element of the list1 is a ArrayList too. In
Java code, it will be like:

for(int i=0; ilist1.size();i++){
ArrayList sublist=(ArrayList)list1.get(i);
   for(int k=0; isublist.size();k++){
System.out.println(sublist.get(k));
   }
}

Now if I set list1as an attribute of a bean, how could I use logic tag to
show the data in the sublist? Can I use nested logic tag? It seems not
working.

Thanks for your help,

Kathy





nested logic tag

2004-05-13 Thread Kathy Zhou
I need your help on how to use nested logic tag:

I have a ArrayList list1. each element of the list1 is a ArrayList too. In 
Java code, it will be like:

for(int i=0; ilist1.size();i++){
ArrayList sublist=(ArrayList)list1.get(i);
   for(int k=0; isublist.size();k++){
System.out.println(sublist.get(k));
   }
}

Now if I set list1as an attribute of a bean, how could I use logic tag to 
show the data in the sublist? Can I use nested logic tag? It seems not 
working.

Thanks for your help,

Kathy





-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



RE: nested logic tag

2004-05-13 Thread Kathy Zhou
Just follow-up my previous note: I got this work by using:

logic:iterate id=trb name=list1   
logic:iterate id=sub name=trb
bean:write name=sub /br/
/logic:iterate
/logic:iterate

fyi,

Kathy

-Original Message-
From:   Kathy Zhou [SMTP:[EMAIL PROTECTED]
Sent:   Thursday, May 13, 2004 2:39 PM
To: '[EMAIL PROTECTED]'
Subject:nested logic tag

I need your help on how to use nested logic tag:

I have a ArrayList list1. each element of the list1 is a ArrayList too. In 
Java code, it will be like:

for(int i=0; ilist1.size();i++){
ArrayList sublist=(ArrayList)list1.get(i);
   for(int k=0; isublist.size();k++){
System.out.println(sublist.get(k));
   }
}

Now if I set list1as an attribute of a bean, how could I use logic tag to 
show the data in the sublist? Can I use nested logic tag? It seems not 
working.

Thanks for your help,

Kathy





-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]


-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



logic tag

2004-05-09 Thread vancega
I am new to struts. I have a question regarding logic tag.
I was replacing those if else if . end if stuffs with logic tags on jsp pages.
For example:

if  num==1 {// condition 1
block 1;
}else if num==2 {// condition 2
block 2;
}

Usually if condition 1 is true, condition 2 does not be evaluated. Now if I use 
logic:equal tag as follows:
logic:equal  (condition 1)
  block 1;
/logic:equal.
logic:notEqual  (condition 2)
block 2;
/logic:notEqual

It seems that condition 2 is always evaluated no matter what the result of condition 1 
is. It would be a performance penalty if this is the case.  Am I wrong? 

Thanks for help,

Kathy





Re: logic tag

2004-05-09 Thread Sven Kiesewetter
[EMAIL PROTECTED] wrote:

I am new to struts. I have a question regarding logic tag.
I was replacing those if else if . end if stuffs with logic tags on jsp pages.
For example:
if  num==1 {// condition 1
block 1;
}else if num==2 {// condition 2
block 2;
}
Usually if condition 1 is true, condition 2 does not be evaluated. Now if I use 
logic:equal tag as follows:
logic:equal  (condition 1)
  block 1;
/logic:equal.
logic:notEqual  (condition 2)
block 2;
/logic:notEqual
It seems that condition 2 is always evaluated no matter what the result of condition 1 is. It would be a performance penalty if this is the case.  Am I wrong? 

Thanks for help,

Kathy

Thats because of the jsp custom tag specification, that does not allow 
data sharing between blocks.

Sven

-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]