• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

JSP in JSF

 
amarshi mohanty
Ranch Hand
Posts: 110
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi All,
Can I use scriplets to define a list inside a jsf file(.xhtml).

--Amarshi
 
H Jetly
Ranch Hand
Posts: 41
Google Web Toolkit Redhat Tomcat Server
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Why would you want to use a scriplet?
Which scenario would a scriplet score over the managed bean ?

JSF gives you a managed bean, you can write all the code present in the scriplets in the managed bean.
 
Tim Holloway
Saloon Keeper
Pie
Posts: 18212
53
Android Eclipse IDE Linux
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
It's not even that good an idea to use scriptlets on plain old JSPs, except in occasional small doses.

Scriptlets are logic. JSF is an implementation of MVC. In MVC, you don't put logic on the View.

Also, JSF is not a linear translation of the View definition into Java code the way JSPs are. Instead the view is compiled into a data tree. Positional logic such as JSTL and scriptlets don't fit into the tree and the results can be unpredictable. And usually bad.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic