I have a Select开发者_JAVA百科OneMenu driven by a List, each of which contains an object value and a string label, along with a converter. All fairly standard. I initially got the Validation Error: Value is not valid error because of a typo in the equals method, but a quick search on how to fix that brings up another question:
Am I right in my understanding that, in this scenario, what happens is:
- An item is selected in the menu.
- This sends a string value to the server.
- The converter is used to convert the string value to an object.
- JSF checks that the object exists in the list of items.
- The setter method is called passing the object.
If so, then can I disable step 4? My converter will throw a ConverterException if the value is not valid, so for me this second list traversal is completely unnecessary.
Cheers,
Barney
This is by design. It's one of the standard website attack preventions. You can't turn it off.
Just put the bean in view scope (so that it won't be refetched on every request, for the case that), or look for a less secure MVC framework if it bothers you.
精彩评论