Turning off scriptlet support in JSP

As I stated a little bit earlier I am not really fond of writing stuff about some specific technical topics but probably I’ll start doing exemptions. In the end, it is the technology that makes our software work :).

Just recently I was talking with  +Mantas Aleknavičius and saying that JSP is one of the greatest templating systems that I know of but it has that really annoying thing - scriptlets. Apparently you can turn off them and I wasn’t aware of this until he showed me how actually to do that. Just put this in your web.xml:

    <jsp-config>
        <jsp-property-group>
            <url-pattern>*.jsp</url-pattern>
            <scripting-invalid>true</scripting-invalid>
        </jsp-property-group>
    </jsp-config>

That should do it - no more in-line Java code. Though I am a little bit surprised that some of us hasn’t learned of our past mistakes and are reintroducing inlined code in templates - I am talking here about Play Framework templates.