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 ?    11 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

Explain handling of runtime exceptions.

0 Answers  


What is the jsp:setproperty action?

0 Answers  


How to configure init parameters for jsp?

0 Answers  


Can you call jsp from servlet?

0 Answers  


Differentiate between jsp scriptlet tag and declaration tag.

0 Answers  






What is the need for jsp?

0 Answers  


What will happen if iselignored attribute is set as false?

0 Answers  


Which is better jsp or javascript?

0 Answers  


Explain the <jsp:param> action?

0 Answers  


Can you override jspinit() method? If yes, in which cases?

0 Answers  


What is scriptlet, expression and declaration in jsp?

0 Answers  


what will happen if we disable cookies in the web page?

7 Answers  


Categories