File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
The moose likes JSF and the fly likes application.createComponent vs Constructor Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Spring in Action this week in the Spring forum!
JavaRanch » Java Forums » Java » JSF
Bookmark "application.createComponent vs Constructor" Watch "application.createComponent vs Constructor" New topic
Author

application.createComponent vs Constructor

nimo frey
Ranch Hand

Joined: Jun 28, 2008
Posts: 580
Hello,

should I use this way:



or that way:


which way is better (difference?)
[ August 19, 2008: Message edited by: nimo frey ]
Bauke Scholtz
Ranch Hand

Joined: Oct 08, 2006
Posts: 2458
Application#createComponent() is JSF implementation dependent. It might for example either return just HtmlOutputText or another component which extends HtmlOutputText. You for one can also have extended HtmlOutputText and if you want to use it in the createComponent() instead, then you can use Application#addComponent() for it.

If you don't need it all, then just instantiating it plain is sufficient and it is performancewise also a bit faster.
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: application.createComponent vs Constructor