This week's book giveaway is in the JavaScript forum.
We're giving away four copies of Svelte and Sapper in Action and have Mark Volkmann on-line!
See this thread for details.
Win a copy of Svelte and Sapper in Action this week in the JavaScript forum!
  • 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 all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Ron McLeod
  • Paul Clapham
  • Bear Bibeault
  • Junilu Lacar
Sheriffs:
  • Jeanne Boyarsky
  • Tim Cooke
  • Henry Wong
Saloon Keepers:
  • Tim Moores
  • Stephan van Hulst
  • Tim Holloway
  • salvin francis
  • Frits Walraven
Bartenders:
  • Scott Selikoff
  • Piet Souris
  • Carey Brown

JSP in JSF

 
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
 
Ranch Hand
Posts: 41
Google Web Toolkit Tomcat Server Redhat
  • 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.
 
Saloon Keeper
Posts: 22492
151
Android Eclipse IDE Tomcat Server Redhat Java 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.
 
Montana has cold dark nights. Perfect for the heat from incandescent light. Tiny ad:
Thread Boost feature
https://coderanch.com/t/674455/Thread-Boost-feature
    Bookmark Topic Watch Topic
  • New Topic