All Downloads are FREE. Search and download functionalities are using the official Maven repository.

org.tinygroup.weblayer.webcontext.lazycommit.LazyCommitWebContext Maven / Gradle / Ivy

The newest version!
/**
 *  Copyright (c) 1997-2013, www.tinygroup.org ([email protected]).
 *
 *  Licensed under the GPL, Version 3.0 (the "License");
 *  you may not use this file except in compliance with the License.
 *  You may obtain a copy of the License at
 *
 *       http://www.gnu.org/licenses/gpl.html
 *
 *  Unless required by applicable law or agreed to in writing, software
 *  distributed under the License is distributed on an "AS IS" BASIS,
 *  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 *  See the License for the specific language governing permissions and
 *  limitations under the License.
 */
package org.tinygroup.weblayer.webcontext.lazycommit;

import org.tinygroup.weblayer.webcontext.TwoPhaseCommitWebContext;


/**
 * 延迟提交response。有些方法的调用会导致response被提交,包括:
 * 
    *
  • sendError
  • *
  • sendRedirect
  • *
  • flushBuffer
  • *
  • setContentLength()或 * setHeader("Content-Length", len),但有些servlet * engine不会在这里提交response。
  • *
* Response一旦提交,就不能修改header了。这对于一些应用(例如cookie-based session)的实现是一个问题。 *

* 本类使用延迟提交来支持这些应用。 *

*

* 注意,本类并未处理getWriter()getOutputStream() * 方法所产生的提交。对于这些方法所产生的提交,需要用BufferedRequestContext来处理。 *

* * @author renhui */ public interface LazyCommitWebContext extends TwoPhaseCommitWebContext { /** * 判断当前请求是否已出现异常。 * * @return 如果出现异常,则返回true */ boolean isError(); /** * 如果sendError()方法曾被调用,则该方法返回一个error状态值。 * * @return error状态值,若系统正常,则返回0 */ int getErrorStatus(); /** * 如果sendError()方法曾被调用,则该方法返回一个error信息。 * * @return error信息,若系统正常,则返回null */ String getErrorMessage(); /** * 判断当前请求是否已被重定向。 * * @return 如果重定向,则返回true */ boolean isRedirected(); /** * 取得重定向的URI。 * * @return 重定向的URI,如果没有重定向,则返回null */ String getRedirectLocation(); /** * 取得最近设置的HTTP status。 * * @return HTTP status值 */ int getStatus(); }




© 2015 - 2025 Weber Informatics LLC | Privacy Policy