What problems can occur when executing a JSP page?
So, I have an example question:
Explain how a JSP page is executed and what kind of problems may occur.
I am fine with the first part, compile static html and scriptlets in java for servlet serving, etc.
But I don't understand what kind of problems might arise? The JSP page is kept in memory ... so maybe this can drain memory? I'm kind of grabbing at straws here ...
a source to share
One potentially problematic thing that many people overlook when writing JSP pages is the fact that JSP declarations, i.e .:
<%! String foo = "bar" %>
create instance variables when they are compiled into servlets, which breaks JSP thread safety.
In general, common problems include using a semicolon at the end of an expression, or not using a semicolon in a scriptlet; trying to get parameters or attributes or session values that are null or are of the wrong type; using the wrong scope when trying to access variables. All kinds of funny things.
a source to share
I must say that the question is a little uncomfortable for me. In general, when you have a JSP page (running), it should handle any exceptions that might arise from scripting, expressions, or other JSP stuff. When you don't handle them by specifying that the web container should redirect the control to an error page when an exception is thrown, things can go wrong :). Of course, an unexpected error can always occur, but this can be dealt with using "Handling unhandled exceptions".
So the answer is that there are an infinite number of errors that can occur depending on what your code is in the JSP page. Is it because you can predict them and process them ahead of time?
a source to share