exceptions during validation

2005-07-07 Thread Daniel Lipofsky
I have my own validator method defined in validator-rules.xml. When an exception is thrown by the validation method, I would expect it to be handled by the global error handling, like what happens when an error is thrown by an action. Instead it proceeds forward just as if validation succeeded with

i18n best practices

2005-04-19 Thread Daniel Lipofsky
I am wondering about best practices in struts for internationalization of dates and numbers. Formatting is not too hard, but parsing and validation is trickier. We must simultaneously handle different formats for different users, so any validation or parsing has to take into account the user's loc

RE: html-el vs html

2005-04-15 Thread Daniel Lipofsky
html-el gives you the ability to process expression language (EL) within the tag attributes. Look at the JSTL docs to see the definition for EL. Look in the "contrib" directory of the struts release to see the TLDs and JARs for html-el. - Dan > -Original Message- > From: Abdullah Jibaly

RE: Load message resources from DB???

2005-03-15 Thread Daniel Lipofsky
Yes, just extend the PropertyMessageResources and overide the loadLocale() method. You should extend the factory too and specify the new factory in struts-config.xml. Add a method to clear the cache in the PropertyMessageResources and clear it when the user changes something. - Dan > -Origin

RE: Proper n tiered exception handling

2005-02-15 Thread Daniel Lipofsky
Why do you do all that work to print the stack trace? Shouldn't exception.printStackTrace(out) do what you want? This also follows the exception.getCause() chain and prints out nested exceptions. As a side note, if you really want to log all nested exceptions then you have to do a little extra wor

RE: wizard form and checkboxes that won't turn off

2005-02-08 Thread Daniel Lipofsky
That's definitely one solution. The other is to have an onsubmit method on the form with javascript to iterate over all the input elements in the form, find unchecked check-boxes, and create a hidden input with the same name and a value of "false". - Dan > -Original Message- > From: James

RE: using bean:write to write out html

2005-01-03 Thread Daniel Lipofsky
Set filter=false in the bean:write tag. RTFM for more info. > -Original Message- > From: kjc [mailto:[EMAIL PROTECTED] > Sent: Monday, January 03, 2005 5:58 PM > > I'm trying to use the struts bean:write tag to render an html page. > The html that I would like to display is generated

RE: setAttribute

2004-12-30 Thread Daniel Lipofsky
It is available for the duration of the HTTP request. That may be more than one page if you are forwarding (server-side) but if you are not it is more or less equivalent to a page. The 4 scopes are page, request, session, application so if you want to keep something for longer you probably want to

RE: more message questions

2004-12-30 Thread Daniel Lipofsky
If you use Struts-EL you can use and use EL syntax for arg0, arg1, etc. The syntax in the .properties file is still '{0}', etc. But I think that is best for flexibility and robustness. Otherwise the property file has to assume a bean with a certain name will exist and name changes would have to

RE: message resources in db

2004-12-29 Thread Daniel Lipofsky
> -Original Message- > From: Jim Barrows [mailto:[EMAIL PROTECTED] > Sent: Wednesday, December 29, 2004 8:15 AM > To: Struts Users Mailing List > Subject: RE: message resources in db > > > -Original Message- > > From: Nathan Coast [mailto:[EMAIL PROTECTED] > > Sent: Wednesday,

Validate only if existing

2004-12-28 Thread Daniel Lipofsky
I have a field I want to require only if the bean it exists inside exists (is not null). I cannot use validwhen because I am using struts 1.1. I tried to use requiredif like this field[0]

RE: How to get the bean value inside JSP

2004-12-28 Thread Daniel Lipofsky
You should probably use bean:define instead of bean:parameter. Even better learn JSTL and use c:set, c:if, and c:forEach to facilitate you. You will find JSTL has better versions of everything in the struts "logic" and "bean" taglibs. I don't think there is any readymade tags for grouping. But if

RE: bean:message and escaping

2004-12-21 Thread Daniel Lipofsky
Can you just escape it in your .properties file or whereever the message is defined? I think that would be best practice unless you need to only escape it some of the time. - Dan > -Original Message- > From: Edgar Poce [mailto:[EMAIL PROTECTED] > Sent: Saturday, December 18, 2004 2:42 PM

RE: [ot]Excluding BeanUtils from Log4J? How do I do this?

2004-12-21 Thread Daniel Lipofsky
You can also set "additivity" to false for the class or package, which prevents it from inheriting appenders. You will have to look up the syntax yourself, since I do not use the XML style. - Dan > -Original Message- > From: Hubert Rabago [mailto:[EMAIL PROTECTED] > Sent: Tuesday, Decemb

RE: bean:write and apostrophes

2004-12-17 Thread Daniel Lipofsky
7;s Test"); %> <% session.setAttribute("y","The \"other\" test"); %> Works in IE and Firefox/Mozilla (and I assume other browsers too). - Dan > -Original Message- > From: Daniel Lipofsky > Sent: Thursday, January 22, 2004 5:22 PM >

bean:message and null or empty keys

2004-06-17 Thread Daniel Lipofsky
I have this problem with bean:message. I would like it to output nothing if the key is null or empty. I tried these 2 forms: But I get ???en_US.null??? or ???en_US.??? for these. If I set null="true" in my message resources they throw exceptions instead. Also if myProp is an Integer the fir

list of modules

2004-04-20 Thread Daniel Lipofsky
I have one web module with many struts modules. I am wondering if there is a way to get a hold of the list of modules? I have 1 shared action servlet and I want to get the list of modules in the init() method. Thanks, Dan - To u