|
INTERVIEW QUESTIONS
J2EE
JSP
DETAILS
Question: How can I declare methods within my JSP page?
Answer: You can declare methods for use within your JSP page as declarations. The methods can then be invoked within any other methods you declare, or within JSP scriptlets and expressions. Do note that you do not have direct access to any of the JSP implicit objects like request, response, session and so forth from within JSP methods. However, you should be able to pass any of the implicit JSP variables as parameters to the methods you declare. For example: Another Example: file1.jsp: file2.jsp <%test(out);% >
|
|
|
Category |
JSP Interview Questions & Answers -
Exam Mode /
Learning Mode
|
Rating |
(0.3) By 6898 users |
Added on |
9/16/2014 |
Views |
70268 |
Rate it! |
|
|
Question:
How can I declare methods within my JSP page?
Answer:
You can declare methods for use within your JSP page as declarations. The methods can then be invoked within any other methods you declare, or within JSP scriptlets and expressions. Do note that you do not have direct access to any of the JSP implicit objects like request, response, session and so forth from within JSP methods. However, you should be able to pass any of the implicit JSP variables as parameters to the methods you declare. For example: Another Example: file1.jsp: file2.jsp <%test(out);% > Source: CoolInterview.com
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 |
|
Is it possible to share an HttpSession between a JSP and EJB? What happens when I change a value in the HttpSession from inside an EJB?
|
View Answer
|
|
How do I use comments within a JSP page?
|
View Answer
|
|
How does JSP handle run-time exceptions?
|
View Answer
|
|
How do I perform browser redirection from a JSP page?
|
View Answer
|
|
What JSP lifecycle methods can I override?
|
View Answer
|
|
How do you restrict page errors display in the JSP page?
|
View Answer
|
|
How do I prevent the output of my JSP or Servlet pages from being cached by the browser?
|
View Answer
|
|
Why does JComponent have add() and remove() methods but Component does not?
|
View Answer
|
|
How do I include static files within a JSP page?
|
View Answer
|
|
What are stored procedures? How is it useful?
|
View Answer
|
|
In the Servlet 2.4 specification SingleThreadModel has been deprecated, why?
|
View Answer
|
|
How many JSP scripting elements are there and what are they?
|
View Answer
|
|
How to Retrieve Warnings?
|
View Answer
|
|
What Class.forName will do while loading drivers?
|
View Answer
|
|
What information is needed to create a TCP Socket?
|
View Answer
|
|
How many messaging models do JMS provide for and what are they?
|
View Answer
|
|
The code in a finally clause will never fail to execute, right?
|
View Answer
|
|
How can a servlet refresh automatically if some new data has entered the database?
|
View Answer
|
|
Can we use the constructor, instead of init(), to initialize servlet?
|
View Answer
|
|
Is JSP technology extensible?
|
View Answer
|