|
INTERVIEW QUESTIONS
J2EE
JSP
DETAILS
Question: A JSP page, include.jsp, has a instance variable "int a", now this page is statically included in another JSP page, index.jsp, which has a instance variable "int a" declared. What happens when the index.jsp page is requested by the client?
Answer: Compilation error, as two variables with same name can't be declared. This happens because, when a page is included statically, entire code of included page becomes part of the new page. at this time there are two declarations of variable 'a'. Hence compilation error.
|
|
|
Category |
JSP Interview Questions & Answers -
Exam Mode /
Learning Mode
|
Rating |
(0.3) By 8531 users |
Added on |
9/16/2014 |
Views |
68142 |
Rate it! |
|
|
Question:
A JSP page, include.jsp, has a instance variable "int a", now this page is statically included in another JSP page, index.jsp, which has a instance variable "int a" declared. What happens when the index.jsp page is requested by the client?
Answer:
Compilation error, as two variables with same name can't be declared. This happens because, when a page is included statically, entire code of included page becomes part of the new page. at this time there are two declarations of variable 'a'. Hence compilation error. Source: CoolInterview.com
on Source: CoolInterview.com
Answered by: gimen | Date: 7/30/2010
| Contact gimen
on Source: CoolInterview.com
Answered by: gimen | Date: 8/6/2010
| Contact gimen
on Source: CoolInterview.com
Answered by: fogel | Date: 8/14/2010
| Contact fogel
on Source: CoolInterview.com
Answered by: scandi | Date: 8/27/2010
| Contact scandi
on Source: CoolInterview.com
Answered by: swedtours | Date: 9/7/2010
| Contact swedtours
If you have the better answer, then send it to us. We will display your answer after the approval.
Rules to Post Answers in CoolInterview.com:-
- There should not be any Spelling Mistakes.
- There should not be any Gramatical Errors.
- Answers must not contain any bad words.
- Answers should not be the repeat of same answer, already approved.
- Answer should be complete in itself.
|
|
Related Questions |
View Answer |
|
What happens when a page is statically included in another JSP page?
|
View Answer
|
|
Why is _jspService() method starting with an '_' while other life cycle methods do not?
|
View Answer
|
|
Can we override the jspInit(), _jspService() and jspDestroy() methods?
|
View Answer
|
|
How is JSP include directive different from JSP include action. ?
|
View Answer
|
|
How to pass information from JSP to included JSP?
|
View Answer
|
|
What is the difference in using request.getRequestDispatcher() and context.getRequestDispatcher()?
|
View Answer
|
|
What is the difference between ServletContext and PageContext?
|
View Answer
|
|
Can we implement an interface in a JSP?
|
View Answer
|
|
How do you delete a Cookie within a JSP?
|
View Answer
|
|
What is the page directive is used to prevent a JSP page from automatically creating a session?
|
View Answer
|
|
How do you connect to the database from JSP?
|
View Answer
|
|
How can I set a cookie and delete a cookie from within a JSP page?
|
View Answer
|
|
How do I use a scriptlet to initialize a newly instantiated bean?
|
View Answer
|
|
How do you prevent the Creation of a Session in a JSP Page and why? What is the difference between include directive & jsp:include action?
|
View Answer
|
|
How do I mix JSP and SSI #include? What is the difference between include directive & jsp:include action?
|
View Answer
|
|
How do I mix JSP and SSI #include?
|
View Answer
|
|
What is JSP?
|
View Answer
|
|
Can a JSP page instantiate a serialized bean?
|
View Answer
|
|
Can you make use of a ServletOutputStream object from within a JSP page?
|
View Answer
|
|
Is there a way I can set the inactivity lease period on a per-session basis?
|
View Answer
|
Please Note: We keep on updating better answers to this site. In case you are looking for Jobs, Pls Click Here Vyoms.com - Best Freshers & Experienced Jobs Website.
View All JSP Interview Questions & Answers - Exam Mode /
Learning Mode
|