File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
The moose likes JSP and the fly likes JSP: make app crash if EL variable unknown or namespace not declared Big Moose Saloon
  Search | Java FAQ | Recent Topics
Register / Login


JavaRanch » Java Forums » Java » JSP
Reply Bookmark "JSP: make app crash if EL variable unknown or namespace not declared" Watch "JSP: make app crash if EL variable unknown or namespace not declared" New topic
Author

JSP: make app crash if EL variable unknown or namespace not declared

manuel aldana
Ranch Hand

Joined: Dec 29, 2005
Posts: 308
Hi,

several times the page displayed fine though a corrupt data was used inside a JSP like:
...
${nonExistentVar.bla}
...


The same counts for using jsp tags where jsp-namespace are not declared:
<!-- c: namespace not declared in jsp header
<c:if.....>


Is there a way/configuration to make the app crash if such coding errors are inside JSP? It is really annoying if page shows up though JSPs contain wrong stuff. In my view this should be default setting....

thanks.


aldana software engineering blog & .more
Bear Bibeault
Author and opinionated walrus
Marshal

Joined: Jan 10, 2002
Posts: 48799

The EL specification clearly states what conditions will result in errors and which will result in empty output. There are no settings to adjust this.


[Smart Questions] [JSP FAQ] [Books by Bear] [Bear's FrontMan] [About Bear]
manuel aldana
Ranch Hand

Joined: Dec 29, 2005
Posts: 308
I see,

for the EL side I think it is a very bad approach to filtering out buggy markup. I wished here EL would go the freemarker way, where at a empty you have to explicitly append a '?' to tell that it should produce empty string otherwise an exception is thrown.
 
 
subject: JSP: make app crash if EL variable unknown or namespace not declared
 
MyEclipse, The Clear Choice