How to ban JSP scriptlet in JSF Facelet application.

Wednesday, September 9, 2009 14:08
Posted in category Java EE


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>
Share and Enjoy:
  • Digg
  • del.icio.us
  • Netvouz
  • DZone
  • ThisNext
  • MisterWong
  • Wists
  • blogmarks
  • Furl
  • Reddit
  • Spurl
  • StumbleUpon
  • Technorati
  • YahooMyWeb
  • Facebook
  • Live
  • Yahoo! Buzz
You can leave a response, or trackback from your own site.

One Response to “How to ban JSP scriptlet in JSF Facelet application.”

  1. Kotali says:

    October 4th, 2009 at 11:49 am

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

Leave a Reply