• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

JSP in JSF

 
Ranch Hand
Posts: 110
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi All,
Can I use scriplets to define a list inside a jsf file(.xhtml).

--Amarshi
 
Ranch Hand
Posts: 41
Google Web Toolkit Tomcat Server Redhat
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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.
 
Saloon Keeper
Posts: 27762
196
Android Eclipse IDE Tomcat Server Redhat Java Linux
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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.
reply
    Bookmark Topic Watch Topic
  • New Topic