jsp

How to make JavaServer Pages (JSP) Expression Language (EL) throw an error if i have an invalid expression?


I am trying to use JavaServer Pages (JSP) Expression Language (EL) syntax to output a value. For example:

<!doctype html>
<body>
   Hello, ${formBeanBame.propertyName}
</body>
</html>

Unfortunately, i don't know what my expression should be. I don't know if the name formBeanName is valid. (i just saw it randomly on another question) It is almost certainly the case that using:

formBeanName

is not correct. (I certainly don't remember ever creating an object, class, variable, or configuration file name with a value of formBeanName).

So i need JSP EL to tell me when the expression is invalid.

I can confirm that formBeanName is not a magic sentinel-value, and it simply is eating errors, by changing my code to:

<!doctype html>
<body>
   Hello, ${asdfasgfarsdfh.propertyName}
</body>
</html>

And it still raises no error, and simply outputs:

Hello,

How can i make JSP EL tell me when I've made a mistake.

Bonus Question: What is the name of my form bean name, and how would i know?


Solution

  • In this partciular case, to answer this particlar question, the answer to this question, as Dave said, the answer is to this particular question is:

    The answer is: it's not possible.