«

»

Sep
09

How to ban JSP scriptlet in JSF Facelet application.


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]
Rating: 0 (from 0 votes)
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/

3 comments

  1. Kotali (http://www NULL.sun NULL.com) says:

    Thanks man, i was in search of this stuff and end up now with you solution. Keep up the good stuff.

    VA:F [1.9.13_1145]
    Rating: 0.0/5 (0 votes cast)
    VA:F [1.9.13_1145]
    Rating: 0 (from 0 votes)
  2. Markus (http://www NULL.facebook NULL.com/profile NULL.php?id=100003405405581) says:

    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?

    VA:F [1.9.13_1145]
    Rating: 0.0/5 (0 votes cast)
    VA:F [1.9.13_1145]
    Rating: 0 (from 0 votes)
  3. rwaplfb (http://lnopdoezoelf NULL.com/) says:

    DoHzMH cdrvxexvvrhp (http://cdrvxexvvrhp NULL.com/)

    VA:F [1.9.13_1145]
    Rating: 0.0/5 (0 votes cast)
    VA:F [1.9.13_1145]
    Rating: 0 (from 0 votes)

Leave a Reply

Your email address will not be published.

You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>