Building JSF Scriplet-free Web Pages with Expression Language & JSTL
Scriptlets (embedded Java code in JSP) are considered to be hazardous from a maintenance standpoint. Especially in JSF development, they should be dumped. The JSP 2.0 specification allows developers to explicitly ban the use of scriptlets by making the following declaration in web.xml:
<jsp-config>
<jsp-property-group>
<url-pattern>*.jsp</url-pattern>
<scripting-invalid>true</scripting-invalid>
<is-xml>true</is-xml>
</jsp-property-group>
</jsp-config>
VN:F [1.9.13_1145]
Rating: 10.0/10 (1 vote cast)
VN:F [1.9.13_1145]
How to ban JSP scriptlet in JSF Facelet application., 10.0 out of 10 based on 1 rating
About the author
Faisal Basra
Faisal Basra is an independent consultant, software developer, writer, blogger, speaker, architect and technology leader in Lahore, Pakistan. He has been a professional software developer since 2008, has been writing code since 2006.
Having hands on experience of popular Java EE frameworks & technologies like JSF, Spring, Hibernate, Enverse, JPA, Richfaces, Primefaces, JSP/Servlet.
I have taken many initiatives while working with teams. Some of includes Automated Build & Release Management system via Hudson, Maven, Archiva & SVN.
Blogging is my hobby and I also initiated blog at corporate level from setting up complete blog for company, content generation strategy and visibility over the Internet by Internet Marketing.
Framworks & Technologies:
JSF, Richfaces, Primefaces, Openfaces, Struts, Hibernate, Spring, ORMLite
Tools & Servers:
jUnit, Log4j, Maven, Eclipse, MyEclipse, NetBeans, Tomcat, Jboss, WebLogic
Mobile Development:
Google Android
Marketing:
Internet Marketing, Mobile App Marketing
Permanent link to this article: http://www.javaplex.com/blog/how-to-ban-jsp-scriptlet-in-jsf-facelet-application/
Leave a Reply
3 comments
Kotali (http://www NULL.sun NULL.com) says:
October 4, 2009 at 11:49 am (UTC 5)
Thanks man, i was in search of this stuff and end up now with you solution. Keep up the good stuff.
Markus (http://www NULL.facebook NULL.com/profile NULL.php?id=100003405405581) says:
February 8, 2012 at 9:59 pm (UTC 5)
Thank you so much! … Thank you so much! It helps me a lot. It’s very uufesl to whom is learning JEE!Great Job!… 0Was this answer helpful?
rwaplfb (http://lnopdoezoelf NULL.com/) says:
February 9, 2012 at 6:37 pm (UTC 5)
DoHzMH cdrvxexvvrhp (http://cdrvxexvvrhp NULL.com/)