• Post Reply Bookmark Topic Watch Topic
  • New Topic

JSTL "not registered with the PropertyEditorManager" error  RSS feed

 
Sylvia Espe
Greenhorn
Posts: 15
  • Mark post as helpful
  • send pies
  • 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
 
Bear Bibeault
Author and ninkuma
Marshal
Posts: 66207
151
IntelliJ IDE Java jQuery Mac Mac OS X
  • Likes 1
  • Mark post as helpful
  • send pies
  • 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
  • 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
  • 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
Author and ninkuma
Marshal
Posts: 66207
151
IntelliJ IDE Java jQuery Mac Mac OS X
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!