Win a copy of Cross-Platform Desktop Applications: Using Node, Electron, and NW.js this week in the JavaScript forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic

What is the exact role of converter in JSF  RSS feed

 
Ram Suryanshi
Greenhorn
Posts: 10
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi

Can you please tell me the exact behavior of converter
in JSF.

Like what exactly it will do.?

Thanks,
Ram
 
Mark Spritzler
ranger
Sheriff
Posts: 17309
11
IntelliJ IDE Mac Spring
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I hate posting the obvious, but it converts things. So, basically everything that is passed from the page back to the server is in String format, so if there is a date or a boolean, that String has to be converted into the appropriate backing bean's type for those attributes.

Sometimes, you might not have a standard conversion between String and what type you have on the server, and you might have to create your own converter. So JSF has an interface and you write the code to convert the Form data into whatever object you need.

Mark
 
Bauke Scholtz
Ranch Hand
Posts: 2458
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
This article perfectly illustrates when a converter is useful:
http://balusc.blogspot.com/2007/09/objects-in-hselectonemenu.html
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!