Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.

Bug 313926

Summary: Validation of f:loadBundle's basename attribute doesn't take localization into account
Product: [WebTools] Java Server Faces Reporter: Preston Appel <preston.appel>
Component: CoreAssignee: JSF Project Core <jsf.core-inbox>
Status: NEW --- QA Contact:
Severity: normal    
Priority: P3 CC: cameron.bateman, preston.appel, raghunathan.srinivasan, ripsi_1, yurykats
Version: unspecified   
Target Milestone: Future   
Hardware: PC   
OS: Windows XP   
Whiteboard:

Description Preston Appel CLA 2010-05-21 11:38:25 EDT
Build Identifier: M20100211-1343

I have a localized resource bundle in my "resources" package, "Greeting_en.properties", without the parent "Greeting.properties".  Referencing this resource bundle by base name like this, <f:loadBundle basename="resources.Greeting" var="g"/> results in a validation error from the Web Page Editor: "Resource bundle resources.Greeting cannot be found on classpath".

I have confirmed with both WebLogic server 10.3.3.0 and Glassfish server v3 Java EE 6 that this is permissible, so the validation is in error.

I believe the problem is that the validation in org.eclipse.jst.jsf.taglibprocessing.attributevalues.ResourceBundleType’s isValid method doesn't take localization into account.  The isValid method calls LoadBundleUtil’s getLoadBundleResource method.  This tries to confirm the existence of the specific "resources/Greeting.properties" file in either the src folder or in the project library jars.  But it doesn't look for localized versions of the file.

Reproducible: Always

Steps to Reproduce:
1.  Create a dynamic web project
2.  Create Greeting_en.properties file (but *no* Greeting.properties) file in src/resources. 
3.  Reference the base name in a JSP file as <f:loadBundle basename="resources.Greeting" var="g"/>

Expected: Passes validation/no error
Actual: Error is flagged as "Resource bundle resources.Greeting cannot be found on classpath"
Comment 1 Yury Kats CLA 2010-05-26 16:23:41 EDT
Same issue as bug 145288, I believe.