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 Question
Advanced Java Interview Question

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.

Download Advanced Java Interview Questions And Answers PDF

Previous QuestionNext Question
Why use a datasource when you can directly specify a connection details? (in a J2EE application)?How will the struts know which action class to call when you submit a form?