Chinaunix首页 | 论坛 | 博客
  • 博客访问: 590941
  • 博文数量: 748
  • 博客积分: 5000
  • 博客等级: 大校
  • 技术积分: 5005
  • 用 户 组: 普通用户
  • 注册时间: 2008-09-08 12:36
文章分类

全部博文(748)

文章存档

2011年(1)

2008年(747)

我的朋友

分类:

2008-09-08 18:23:31

    项目中需要通过一链接直接进入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---------------------

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