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
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 |
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 |
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 |
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 |
Why does the tag url-encode javascript and mailto links?
what's the main difference between unix os and linux os?
what are the software's needed to develop advanced java 3 tier application project
What is the difference between RMI and Socket?
What is the infobus?
What is the purpose of the finally clause of a try-catch-finally statement?
diff between jsp include directive and jsp action include?
Is System.err.println(""Statement"); is execute the output on console . Example: System.err.println("Hello JAVA");
int x=5,i=1,y=0; while(i<=5) { y=x++ + ++x; i=i+2; } System.out.println(x); System.out.println(y); System.out.println(i); How to solve this? Please explain!
Define the remote object implementation?
Is the infobus client side only?
What are the pros and cons of detached objects?