Without Book Interview Questions and Answers | Online Test | Moct Test
Download Android App in your Android Device from Google Play Store
- Search for "Withoutbook Practice Exam Test" in Mobile/Tablet Play Store
Institute Training Search by Name or Email

Exams Attended

Make Homepage

Bookmark this page

Subscribe Email Address

JSP Interview Questions and Answers

Ques 46. What is the difference between variable declared inside a declaration and variable declared in scriplet?

Ans. Variable declared inside declaration part is treated as a instance variable and will be placed directly at class level in the generated servlet.
<%! int k = 10; %>
Variable declared in a scriptlet will be placed inside _jspService() method of generated servlet.It acts as local variable.
<%
int k = 10;
%>

Is it helpful? Add Comment View Comments
Ques 47. How is scripting disabled?
Ans. Scripting is disabled by setting the scripting-invalid element of the deployment descriptor to true. It is a subelement of jsp-property-group. Its valid values are true and false. The syntax for disabling scripting is as follows:

<jsp-property-group>
<url-pattern>*.jsp</url-pattern>
<scripting-invalid>true</scripting-invalid>
</jsp-property-group>
Is it helpful? Add Comment View Comments
Ques 48. What is the difference between ServletContext and PageContext?
Ans. ServletContext: Gives the information about the container and it represents an application.

PageContext: Gives the information about the Request and it can provide all other implicit JSP objects.
Is it helpful? Add Comment View Comments
Ques 49. What is JSP Compiler and where are compiled JSP Java files?
Ans. JSP are automatically compiled at runtime.

The compiled JSP files are by default available in the /work folder of the Tomcat environment. There should be a subfolder Catalina which in turn has a subfolder representing the domain name which defaults to localhost. There in turn should be the project folder which in turn contains package hierarchy org.apache.jsp with therein the compiled JSP files.
Is it helpful? Add Comment View Comments

Most helpful rated by users:

©2016 WithoutBook