servlet-about
guoyf
这个作者很懒,什么都没留下…
展开
-
设置错误处理
通常的http访问异常包含404 Not Found和500 Internal Error,为了提供给用户更为友好的显示,可以做如下配置: 404 /common/404.jsp 500 /common/500.jsp 通过如上配置,当用户访问应用中不存在的页面时,将会将用户导向到/common/404.jsp页面。同样地,当出现异常原创 2004-09-01 15:58:00 · 734 阅读 · 0 评论 -
Request parameters & Request attributes
1、两者都是放入HttpServletRequest对象中。2、Request parameters是通过URL语句中的参数(/logon?action=create)和post方法中的数据插入到HttpServletRequest对象中的;通过HttpServletRequest.getParameter(String strParaName)得到;目的是在服务器端得到客户端的数据。3、原创 2004-09-03 16:00:00 · 747 阅读 · 0 评论 -
Forward & Redirect
1、两者的目的是为了实现HttpServletRequst对象的共享2、HttpServletResponse.sendRedirect(),容器将把新的URL发送给客户端,客户端将会发生一次新的请求,这样所有的放在HttpServletRequest中的request attributes对象将会失效。而RequestDispatcher.forward()是在容器内发生的,并没有把原创 2004-09-03 17:10:00 · 545 阅读 · 0 评论 -
The Web Application Deployment Descriptor
The web application deployment descriptor conveys configuration information between application developers, deployers, and assemblers. Web containers also use the descriptor to configure and load web原创 2004-09-07 17:02:00 · 875 阅读 · 0 评论 -
Servlet API类框图
原创 2004-08-31 15:37:00 · 541 阅读 · 0 评论 -
Mapping requests to servlets
This is a good time to digress for a moment and discuss how the URLs that a user types into a browser are mapped to the correct web application and servlet. When a web application is installed in a co原创 2004-09-07 17:40:00 · 645 阅读 · 0 评论 -
有关Action的线程安全问题
拿jsp描述:JSP默认是以多线程方式执行的,这是JSP与ASP,PHP,PERL等脚本语言不一样的地方,也是它的优势之一,但如果不注意多线程中的同步问题,会使所写的JSP程序有难以发现的错误。引起原因:(1)实例变量 实例变量是在堆中分配的,并被属于该实例的所有线程共享,所以不是线程安全的. (2)JSP系统提供的8个类变量 JSP中用到的OUT,REQUEST,RESPONSE,SES原创 2004-09-15 16:04:00 · 1165 阅读 · 0 评论 -
ActionServlet's init()
1、Initialize the frameworks internal message bundle. These messages are used to output informational, warning, and error messages to the log files. The org.apache.struts.action.ActionResources bund原创 2004-09-13 17:29:00 · 676 阅读 · 0 评论