If I define a method in JSP scriplet <%..%>, where will it
go after translation into a servlet?

Answer Posted / prs01

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.

Is This Answer Correct ?    35 Yes 1 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

What is the purpose of the wait(), notify(), and notifyall() methods?

564


Is jvm a overhead?

619


What is a session? Can you share a session object between different theads?

550


Is there a guarantee of uniqueness for entity beans?

566


Why does the option tag render selected=selected instead of just selected?

671






What classes of exceptions may be caught by a catch clause?

547


What is the diffrence between a local-tx-datasource and a xa-datasource?

576


What is the argument type of a programs main() method?

558


Which container method is used to cause a container to be laid out and redisplayed?

660


Explain phantom read?

1733


Can I have an action without a form?

588


What is permgen or permanent generation?

581


What is clustering? What are the different algorithms used for clustering?

574


Can you give me a simple example of using the requiredif validator rule?

597


What event results from the clicking of a button?

691