• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Tim Cooke
  • paul wheaton
  • Liutauras Vilda
  • Ron McLeod
Sheriffs:
  • Jeanne Boyarsky
  • Devaka Cooray
  • Paul Clapham
Saloon Keepers:
  • Scott Selikoff
  • Tim Holloway
  • Piet Souris
  • Mikalai Zaikin
  • Frits Walraven
Bartenders:
  • Stephan van Hulst
  • Carey Brown

JSTL "not registered with the PropertyEditorManager" error

 
Greenhorn
Posts: 15
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I'm a novice to JSTL. My app needed to include some text stored on another server so I installed JSTL exclusively to use c:import and accomplish this. The server I need to get the content from is stored in a properties file, myApp.properties let's call it. Prior to using JSTL, anytime I needed access to a key value pair in the properties file, I used the following code either in the appropriate Java class or directly in the JSP:

This doesn't work for me now, as I can't use <%=contentLocation> in JSTL (the end result is want something like this <c:import url="<%=contentLocation %>index.html"/> but I can't use the JSP variable in JSTL).

So, I tried accessing the properties file via JSTL instead like this:

and I get the following error:

Unable to convert string "${ message }" to class "javax.servlet.jsp.jstl.fmt.LocalizationContext" for attribute "bundle": Property Editor not registered with the PropertyEditorManager


Do I need to register this properties file somewhere? If I do that, will it mess up getting values of it the Java code way? (since that's used elsewhere in the code to access other values in this file). Any tips or hints would be great.

This is JSTL 1.1, servlet version 2.4, JSP engine 2.0 and Tomcat 5.5.23
 
Sheriff
Posts: 67752
173
Mac Mac OS X IntelliJ IDE jQuery TypeScript Java iOS
  • Likes 1
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I'm pretty sure that spaces aren't a problem, but ${ message } should be written as ${message} if for convention if nothing else.

Is the EL enabled in your pages? What does the output of ${3+4} yield? If it's not "7", your app is misconfigured to use the EL.
 
Sylvia Espe
Greenhorn
Posts: 15
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
You are on to something. My output is just "${3+4}". So what am I missing in my setup?
 
Sylvia Espe
Greenhorn
Posts: 15
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Got it figured out. Thanks Bear, your hint is what got me looking around. At some point I had apparently reverted my web.xml back to its original 2.3 declaration. I switched it to 2.4 now and it's all working.

Simply problem, but sometimes it takes posting about it to make you see the error in your ways.
 
Bear Bibeault
Sheriff
Posts: 67752
173
Mac Mac OS X IntelliJ IDE jQuery TypeScript Java iOS
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
 
I will suppress my every urge. But not this shameless plug:
Smokeless wood heat with a rocket mass heater
https://woodheat.net
reply
    Bookmark Topic Watch Topic
  • New Topic