Can we use methods in JSP? If so where the methods are
stored in servlet class file?




Answers were Sorted based on User's Feedback



Can we use methods in JSP? If so where the methods are stored in servlet class file?..

Answer / anto

<%!

action-specifier return type methodname(arguemnts)
{
statements.............or task
}
%>

Is This Answer Correct ?    31 Yes 3 No

Can we use methods in JSP? If so where the methods are stored in servlet class file?..

Answer / mandrita sinha choudhuri

Yes we can write java methods inside jsp files within
the "declarations" tag <!%//the method%>.

This part of the code is compiled by the servlet engine and
inserted outside the _jspservice() method in the generated
servlet class.

Is This Answer Correct ?    38 Yes 11 No

Can we use methods in JSP? If so where the methods are stored in servlet class file?..

Answer / manesh

Mandrita , There is a typo in ur answer.

Its should be <%! //the method%>. not

Regards,
Manesh A. K.

>Yes we can write java methods inside jsp files within
the "declarations" tag <!%//the method%>.
>
>This part of the code is compiled by the servlet engine
and
>inserted outside the _jspservice() method in the generated
servlet class

Is This Answer Correct ?    10 Yes 2 No




Can we use methods in JSP? If so where the methods are stored in servlet class file?..

Answer / madhu

YES We can Write the our own methods or java methods inside
the "JSP Declarations"
Syntax:<%! .................%>

Is This Answer Correct ?    3 Yes 1 No

Can we use methods in JSP? If so where the methods are stored in servlet class file?..

Answer / jayachandra

Description:

We can Develop the methods in jsp pages by using declaation
statements

Sysntex:

<%! //Methods %>

Is This Answer Correct ?    2 Yes 1 No

Can we use methods in JSP? If so where the methods are stored in servlet class file?..

Answer / jhon smith

yes , method are store into class scope.

Is This Answer Correct ?    1 Yes 1 No

Post New Answer



More JSP Interview Questions

What are the steps involved in reading data from a form using jsp?

0 Answers  


HOW CAN WE COMPARE TWO PDF FILES USING JSP ?

0 Answers   TCS,


What is expression language in jsp?

0 Answers  


What are the implicit, internal objects and methods on the jsp page?

0 Answers  


List out the various scope values of jsp action.

0 Answers  






What is difference between sendredirect and requestdispatcher?

0 Answers  


how to insert star image and need to rate it.. one star two star so on how to do in jsp...????

0 Answers  


How to include static files in a jsp?

0 Answers  


Why is _jspservice() method starting with an '_' while other life cycle methods do not?

0 Answers  


What are jsp and servlets?

0 Answers  


List down the major differences between the jsp custom tags and java beans.

0 Answers  


Explain the uses of <jsp:usebean> tag.

0 Answers  






Categories