Advanced Java Question: Download Questions PDF
If I define a method in JSP scriplet <%..%>, where will it go after translation into a servlet?
![Advanced Java Interview Answer Advanced Java Interview Question](https://globalguideline.com/public/images/interview/20.png)
Answer:
It will give compilation error. In order to define a method
in JSP, it should be defined in the JSP declarations <%!..%
>, and it can be called in the JSP expression.
On translation, the method will be added outside all
methods in the servlet class.
in JSP, it should be defined in the JSP declarations <%!..%
>, and it can be called in the JSP expression.
On translation, the method will be added outside all
methods in the servlet class.
Download Advanced Java Interview Questions And Answers
PDF