Well, that's certainly something I can consider for the future. For right now, our product is already pretty huge, and I think I would get shot if I tried to add another set of jars to the classpath, even if in the long run we'd be better off.
The best solution I've been able to come up with is to punt: insert another tile to all of these screens, which is blank if there is no content and a small JSP page if there is content. If there is content, write it out with the usual <bean:message> tag. Does anyone have a better solution? This will be a pain, but I think it will work. Chris -----Original Message----- From: Benedict, Paul C [mailto:[EMAIL PROTECTED] Sent: Thursday, June 09, 2005 1:34 PM To: 'Struts Users Mailing List' Subject: RE: Test whether an application resource is empty Chris, Struts contains an EL package for its tag libraries. Yes, you can use EL! But it doesn't matter if you're using Struts or not. If you're using a Servlet 2.3 container, you can use JSTL which you want to use. If possible avoid the <bean> and <logic> tags, and use JSTL instead. These are built with EL. -----Original Message----- From: Chris Loschen [mailto:[EMAIL PROTECTED] Sent: Thursday, June 09, 2005 1:18 PM To: Struts Users Mailing List Subject: RE: Test whether an application resource is empty Thanks for your help, Paul. I'm trying that, but I'm getting the same results as I did when I used <tiles:useAttribute .../> originally. That is, I'm getting the key, not the value, so I still need to get the value to determine whether it's empty. But when I try to define a bean as the value of <bean:message key="..."/>, it fails when that value is empty (which is what I was trying to check for in the first place!). The project I'm working on is using struts 1.1, so I don't think I have access to the EL tags -- am I mistaken? Chris -----Original Message----- From: Benedict, Paul C [mailto:[EMAIL PROTECTED] Sent: Thursday, June 09, 2005 12:17 PM To: 'Struts Users Mailing List' Subject: RE: Test whether an application resource is empty Chris, Use <tiles:importAttribute .... ignore="true"> to bring in the key. You can then use EL to test if it is empty or whatever. Thanks, Paul -----Original Message----- From: Chris Loschen [mailto:[EMAIL PROTECTED] Sent: Thursday, June 09, 2005 11:37 AM To: Struts Users Mailing List Subject: RE: Test whether an application resource is empty Importance: High I'm sorry to keep sending this over and over again, but I'm really stuck. If this isn't possible, could someone let me know? Then I could try to find an alternate path. Chris -----Original Message----- From: Chris Loschen Sent: Wednesday, June 08, 2005 5:09 PM To: Struts Users Mailing List Subject: RE: Test whether an application resource is empty I'm still spinning my wheels on this -- does anyone have any ideas? Quick synopsis: I have localized i18n messages defined in my tiles definitions which are sometimes empty. I need to test that the value associated with a given key is not empty before I proceed with further processing. I can test that the key is non-empty, but I haven't yet figured out how to test the same thing for the value. If anyone could help, I'd really appreciate it. Thanks! Chris -----Original Message----- From: Chris Loschen Sent: Wednesday, June 08, 2005 1:12 PM To: Struts Users Mailing List Subject: Test whether an application resource is empty Hi all, I'm using struts 1.1. I have localized application resources keys defined in my tiles definition file. In my JSP, I use the tiles attribute and then display the localized message using the key. However, in some cases, the localized value is empty: there is no value for that particular locale or that particular instance. In those cases, I want to avoid writing out the key at all, but I'm having trouble figuring out how to make that test. Specifically, I have tiles defs like this: <definition name=".manageHierarchy.billing.details" extends=".template.manageHierarchy.billing"> <put name="directionToUser" value="tiles.module.admin.manageHierarchy.billing.details.directionToUse r"/> Etc. </definition> And the localized values are something like tiles.main.admin.manageHierarchy.businessStruc.add.directionToUser= (so no value for that key). In my JSP, I've tried several ways to test whether the key value is null or the length is 0, but none of them have worked yet. For example: <tiles:useAttribute id="directionToUser" name="directionToUser" classname="java.lang.String" ignore="true"/> <% if(directionToUser != null && directionToUser.length()>0){ %> <div class="modFormBox"><bean:message key="<%=directionToUser.toString()%>"/></div> <% }%> Problem here is that directionToUser is the key, not the value, so it's never null, and I get the empty div tags I'm trying to avoid. So I tried variations like this: <tiles:useAttribute name="directionToUser" classname="java.lang.String"/> <bean:define id="directionToUserString"> <bean:message name="directionToUser"/> </bean:define> <logic:notEmpty name="directionToUserString"> <div class="modFormBox"><bean:write name="directionToUserString"/></div> </logic:notEmpty> That one returned "Define tag can contain only one of name attribute, value attribute, or body content". I've tried lots of variations similar to that, but haven't struck upon the right one yet. This SEEMS like something which should be pretty simple, but I'm missing something. Any suggestions? Thanks! Chris Loschen _______________ Siebel IT'S ALL ABOUT THE CUSTOMER Visit www.siebel.com This e-mail message is for the sole use of the intended recipient(s) and contains confidential and/or privileged information belonging to Siebel Systems, Inc. or its customers or partners. Any unauthorized review, use, copying, disclosure or distribution of this message is strictly prohibited. If you are not an intended recipient of this message, please contact the sender by reply e-mail and destroy all soft and hard copies of the message and any attachments. Thank you for your cooperation. --------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]