Re: ActionErrors in my JSP: how can I rewrite this RT snippet as EL?

2004-04-23 Thread bOOyah
Takhar, Sandeep wrote:

Craig McLanahan wrote something about this recently.

I may be wrong since I haven't done this, but you may need '' quotes around the property since there are '.'s in it.
No Sandeep, wrapping single quotes around the property didn't seem to 
make any difference.  Not even wrapping the single quotes in double 
quotes ;-)  Niall's suggestion worked well though.

Thanks anyway.

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


Re: ActionErrors in my JSP: how can I rewrite this RT snippet as EL?

2004-04-23 Thread Niall Pemberton
Ha, ha - you have to stand firm mate ;-) - having said that if my wife says
down tools I do too - PDQ!

The ActionMessages class and html:messages tag are new versions which it
seems are there to replace ActionErrors and html:errors so I guess they
are the future. So far I haven't got round to moving over to them yet but
yes, essentially it does the same thing but in a slightly different way.
From what I understand the html:messages tag differs in the following
ways:

* You specify an id attribute in html:messages which specifies a page
scope bean in which the tag will store the current message for each
iteration - I believe you then have to use something to write out the
message - like bean:write

* Using the message=true will display messages stored under the
Globals.MESSAGE_KEY constant (rather than the default Globals.ERROR_KEY ) -
means you can use it for other messages as well as errors.

* html:errors uses the errors.footer and errors.header keys to get the
header/footer from the application resources - html:messages you can
specify these keys using header and footer attributes on the tag - means
you can have different header/footer for different pages.


So to do you're example I believe you would have to do the following:

 logic:messagesPresent
 html:messages id=errorMsg header=errors.header
footer=errors.footer

property=org.apache.struts.action.GLOBAL_MESSAGE
 ulbean:write name=errorMsg//ul
   /html:messages
 /logic:messagesPresent

rather than

 logic:messagesPresent
html:errors  property=org.apache.struts.action.GLOBAL_MESSAGE/
 /logic:messagesPresent


As I said, I haven't tried them out yet - maybe someone who uses them can
confirm whether this is correct or not.

Niall

- Original Message - 
From: bOOyah [EMAIL PROTECTED]
To: [EMAIL PROTECTED]
Sent: Friday, April 23, 2004 12:49 PM
Subject: Re: ActionErrors in my JSP: how can I rewrite this RT snippet as
EL?


 Niall Pemberton wrote:

  It should be
 
  logic:present name=org.apache.struts.action.ERROR
html:errors property=org.apache.struts.action.GLOBAL_MESSAGE/
  /logic:present
 
  .. or even
 
  logic:messagesPresent
html:errors  property=org.apache.struts.action.GLOBAL_MESSAGE/
  /logic:messagesPresent

 Sorry for the delay in replying Niall...my wife MADE ME down tools for a
 day.

 Yes, indeed both your suggestions work perfectly.  I'm using the 2nd
 one.  Am I right then in guessing that

logic:messagesPresent
  html:messages property=org.apache.struts.action.GLOBAL_MESSAGE/
/logic:messagesPresent

 would display all messages (errors or otherwise)?  Is it now that simple?

 What threw me originally is that 'org.apache.struts.action.ERROR' no
 longer exists in the online Struts javadocs.  So I got embroiled in
 following the path of deprecation, and I couldn't get the current
 recommendations to work :-(

 Thanks a mill for your help.

 -- 
 bOOyah


 -
 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: ActionErrors in my JSP: how can I rewrite this RT snippet as EL?

2004-04-22 Thread Takhar, Sandeep
Craig McLanahan wrote something about this recently.

I may be wrong since I haven't done this, but you may need '' quotes around the 
property since there are '.'s in it.

sandeep

-Original Message-
From: Niall Pemberton [mailto:[EMAIL PROTECTED]
Sent: Wednesday, April 21, 2004 8:52 PM
To: Struts Users Mailing List; [EMAIL PROTECTED]
Subject: Re: ActionErrors in my JSP: how can I rewrite this RT snippet
as EL?


It should be 

logic:present name=org.apache.struts.action.ERROR
  html:errors property=org.apache.struts.action.GLOBAL_MESSAGE/
/logic:present

.. or even

logic:messagesPresent
  html:errors  property=org.apache.struts.action.GLOBAL_MESSAGE/
/logic:messagesPresent


- Original Message - 
From: bOOyah [EMAIL PROTECTED]
To: [EMAIL PROTECTED]
Sent: Thursday, April 22, 2004 1:31 AM
Subject: ActionErrors in my JSP: how can I rewrite this RT snippet as EL?


 Hi
 
 I'm displaying validate() ActionErrors in my JSP using the RT 
 html:errors tag.  But I can't seem to be able to successfully rewrite my 
 snippet of Struts RT in EL.
 
 This works:
 
%@ page import=org.apache.struts.Globals%
%@ page import=org.apache.struts.action.ActionMessages%
...
logic-rt:present name=%=Globals.ERROR_KEY%
  html-rt:errors property=%=ActionMessages.GLOBAL_MESSAGE%/
/logic-rt:present
 
 
 But this doesn't work (using the logic  html EL taglibs):
 
%@ page import=org.apache.struts.Globals%
%@ page import=org.apache.struts.action.ActionMessages%
...
logic:present name=org.apache.struts.Globals.ERROR_KEY
  html:errors
 property=org.apache.struts.action.ActionMessages.GLOBAL_MESSAGE/
/logic:present
 
 
 
 Can anyone help?
 
 Thanks
 -- 
 bOOyah
 
 
 -
 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]



ActionErrors in my JSP: how can I rewrite this RT snippet as EL?

2004-04-21 Thread bOOyah
Hi

I'm displaying validate() ActionErrors in my JSP using the RT 
html:errors tag.  But I can't seem to be able to successfully rewrite my 
snippet of Struts RT in EL.

This works:

  %@ page import=org.apache.struts.Globals%
  %@ page import=org.apache.struts.action.ActionMessages%
  ...
  logic-rt:present name=%=Globals.ERROR_KEY%
html-rt:errors property=%=ActionMessages.GLOBAL_MESSAGE%/
  /logic-rt:present
But this doesn't work (using the logic  html EL taglibs):

  %@ page import=org.apache.struts.Globals%
  %@ page import=org.apache.struts.action.ActionMessages%
  ...
  logic:present name=org.apache.struts.Globals.ERROR_KEY
html:errors
property=org.apache.struts.action.ActionMessages.GLOBAL_MESSAGE/
  /logic:present


Can anyone help?

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


Re: ActionErrors in my JSP: how can I rewrite this RT snippet as EL?

2004-04-21 Thread Niall Pemberton
It should be 

logic:present name=org.apache.struts.action.ERROR
  html:errors property=org.apache.struts.action.GLOBAL_MESSAGE/
/logic:present

.. or even

logic:messagesPresent
  html:errors  property=org.apache.struts.action.GLOBAL_MESSAGE/
/logic:messagesPresent


- Original Message - 
From: bOOyah [EMAIL PROTECTED]
To: [EMAIL PROTECTED]
Sent: Thursday, April 22, 2004 1:31 AM
Subject: ActionErrors in my JSP: how can I rewrite this RT snippet as EL?


 Hi
 
 I'm displaying validate() ActionErrors in my JSP using the RT 
 html:errors tag.  But I can't seem to be able to successfully rewrite my 
 snippet of Struts RT in EL.
 
 This works:
 
%@ page import=org.apache.struts.Globals%
%@ page import=org.apache.struts.action.ActionMessages%
...
logic-rt:present name=%=Globals.ERROR_KEY%
  html-rt:errors property=%=ActionMessages.GLOBAL_MESSAGE%/
/logic-rt:present
 
 
 But this doesn't work (using the logic  html EL taglibs):
 
%@ page import=org.apache.struts.Globals%
%@ page import=org.apache.struts.action.ActionMessages%
...
logic:present name=org.apache.struts.Globals.ERROR_KEY
  html:errors
 property=org.apache.struts.action.ActionMessages.GLOBAL_MESSAGE/
/logic:present
 
 
 
 Can anyone help?
 
 Thanks
 -- 
 bOOyah
 
 
 -
 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]