设为首页 加入收藏

TOP

国外的一些jsp面试题(2)
2014-11-16 21:40:03 来源: 作者: 【 】 浏览:30
Tags:国外 一些 jsp 试题

Question: What is JSP Custom tags
Answer: JSP Custom tags are user defined JSP language element. JSP custom tags are user defined tags that can encapsulate common functionality. For example you can write your own tag to access the database and performing database operations. You can also write custom tag for encapsulate both simple and complex behaviors in an easy to use syntax and greatly simplify the readability of JSP pages.


Question: What is JSP
Answer: JavaServer Pages (JSP) technology is the Java platform technology for delivering dynamic content to web clients in a portable, secure and well-defined way. The JavaServer Pages specification extends the Java Servlet API to provide web application developers


Question: What is the role of JSP in MVC Model
Answer: JSP is mostly used to develop the user interface, It plays are role of View in the MVC Model.


Question: What do you understand by context initialization parameters
Answer: The context-param element contains the declaration of a web application’s servlet context initialization parameters.

name
value


The Context Parameters page lets you manage parameters that are accessed through the ServletContext.getInitParameterNames and ServletContext.getInitParameter methods.


Question: Can you extend JSP technology
Answer: JSP technology lets the programmer to extend the jsp to make the programming more easier. JSP can be extended and custom actions and tag libraries can be developed.


Question: What do you understand by JSP translation
Answer: JSP translators generate standard Java code for a JSP page implementation class. This class is essentially a servlet class wrapped with features for JSP functionality.


Question: What you can stop the browser to cash your page
Answer: Instead of deleting a cache, you can force the browser not to catch the page.
<%
response.setHeader(“pragma”,”no-cache”);//HTTP 1.1
response.setHeader(“Cache-Control”,”no-cache”);
response.setHeader(“Cache-Control”,”no-store”);
response.addDateHeader(“Expires”, -1);
response.setDateHeader(“max-age”, 0);
//response.setIntHeader (“Expires”, -1); //prevents caching at the proxy server
response.addHeader(“cache-Control”, “private”);


%>
put the above code in your page.


Question: What you will handle the runtime exception in your jsp page
Answer: The errorPage attribute of the page directive can be used to catch run-time exceptions automatically and then forwarded to an error processing page.


For example:
<%@ page errorPage=”customerror.jsp” %>
above code forwards the request to “customerror.jsp” page if an uncaught exception is encountered during request processing. Within “customerror.jsp”, you must indicate that it is an error-processing page, via the directive: <%@ page isErrorPage=”true” %>.


】【打印繁体】【投稿】【收藏】 【推荐】【举报】【评论】 【关闭】 【返回顶部
分享到: 
上一篇Cisco R&D笔试小结 下一篇数据库理论及基础面试题

评论

帐  号: 密码: (新用户注册)
验 证 码:
表  情:
内  容: