Chinaunix首页 | 论坛 | 博客
  • 博客访问: 499340
  • 博文数量: 1496
  • 博客积分: 79800
  • 博客等级: 大将
  • 技术积分: 9940
  • 用 户 组: 普通用户
  • 注册时间: 2008-09-09 13:22
文章分类

全部博文(1496)

文章存档

2011年(1)

2008年(1495)

我的朋友

分类:

2008-09-09 17:23:18

    项目中需要通过一链接直接进入JSF生命周期, 苦思冥想无法解决. Google之, 得解. 现帖出那位老外的代码, 很有用的工具类.


    public abstract class AbstractFacesServlet extends HttpServlet {

 

        /** Creates a new instance of AbstractFacesServlet */

        public AbstractFacesServlet() {

            super();

        }

 

        public void init(ServletConfig config) throws ServletException {

            super.init(config);

        }

 

        protected abstract void processRequest(HttpServletRequest request,

                HttpServletResponse response) throws ServletException, IOException;

 

        /**

         * Handles the HTTP GET method.

         *

         * @param request

         *            servlet request

         * @param response

         *            servlet response

         */

        protected void doGet(HttpServletRequest request,

                HttpServletResponse response) throws ServletException, IOException {

            processRequest(request, response);

        }

 

        protected void log(FacesContext facesContext, String message) {

            facesContext.getExternalContext().log(message);

        }

 

        /**

         * Handles the HTTP POST method.

         *

         * @param request

         *            servlet request

         * @param response

         *            servlet response

         */

        protected void doPost(HttpServletRequest request,

                HttpServletResponse response) throws ServletException, IOException {

 

[1]    

【责编:landy】

--------------------next---------------------

阅读(132) | 评论(0) | 转发(0) |
给主人留下些什么吧!~~