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

Answers were Sorted based on User's Feedback



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

Answer / 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

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

Answer / prs01

@Karthikeyan ...In Java, you cannot have a method inside
another method (service). You may try the same, in JSP
itself you will get compile time error when defining a
method in scriplets.

Is This Answer Correct ?    15 Yes 0 No

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

Answer / sreenivasulu

no not defined method in scriptlet

Is This Answer Correct ?    6 Yes 2 No

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

Answer / vamsi krishna.i

The code that writes in JSP Scriptlets itself excutes in
service method.We can not create a method with in the
Method.So We cont define a method in <%...%>.

Is This Answer Correct ?    3 Yes 0 No

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

Answer / karthikeyan

the question is the scriptlet code. this scriptlets are
embedded into servlet's service method

Is This Answer Correct ?    4 Yes 3 No

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

Answer / guest

6

Is This Answer Correct ?    1 Yes 0 No

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

Answer / karthik

After translation of jsp code into servlet the scriplets
(<%...%> contents will be executed via the service methods.
suppose if we define the new method inside the scriplte tag
the container will raise the compilation error.

Is This Answer Correct ?    1 Yes 0 No

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

Answer / sreenivasulu

no not defined method in scriptlet

Is This Answer Correct ?    2 Yes 2 No

Post New Answer

More Advanced Java Interview Questions

Should synchronization primitives be used on bean methods?

0 Answers  


What is the difference between a static and a non-static inner class?

0 Answers  


when A client sent a request to the server to open facebook page and close the browser after this request .at that time the same user do login by using a different browser then that session id will exist or not for the same client??

0 Answers   Ducat,


Why won’t the jvm terminate when I close all the application windows?

0 Answers  


What is the need of serialize?

2 Answers   Wipro,






Is multiple try block is possible in single java Application......

3 Answers  


what are the software's needed to develop advanced java 3 tier application project

1 Answers  


What are the ways to define classes that can be run as threads?

1 Answers   KPIT,


What is multi-tasking? Types?

1 Answers  


What’s jboss jbpm?

0 Answers  


What is the use of Class.forName

20 Answers   HCL,


What is waiting state? In what ways a thread can enter into waiting state?

2 Answers   Wipro,


Categories