📄 vraptorcontroller.java
字号:
package xyz.frame.core;import javax.servlet.ServletContext;import javax.servlet.http.HttpServletRequest;import javax.servlet.http.HttpServletResponse;import org.apache.log4j.Logger;import xyz.frame.LogicException;import xyz.frame.LogicRequest;import xyz.frame.Result;import xyz.frame.component.ComponentNotFoundException;import xyz.frame.component.LogicNotFoundException;import xyz.frame.http.XyzRequest;import xyz.frame.interceptor.InterceptorInstantiationException;import xyz.frame.introspector.BasicIntrospector;import xyz.frame.introspector.Introspector;import xyz.frame.url.InternalLogicRequest;import xyz.frame.url.InvalidURLException;import xyz.frame.view.ViewException;import xyz.frame.webapp.WebApplication;/** * Main xyz2 controller. * * @author Guilherme Silveira */public class XyzController { private static final Logger logger = Logger .getLogger(XyzController.class); private Introspector introspector = new BasicIntrospector(); private WebApplication application; private ServletContext servletContext; /** * @param application */ public XyzController(WebApplication application, ServletContext context) { logger.debug("Xyz engine controller instantiated"); this.application = application; this.servletContext = context; } /** * Returns the instrospector * * @return */ public Introspector getIntrospector() { return this.introspector; } /** * @return the application */ public WebApplication getWebApplication() { return application; } /** * @return the context */ public ServletContext getServletContext() { return servletContext; } public Result execute(HttpServletRequest oldRequest, HttpServletResponse response) throws InvalidURLException, ComponentNotFoundException, LogicNotFoundException, ViewException, InterceptorInstantiationException, LogicException { XyzRequest request = new XyzRequest(oldRequest, this); final InternalLogicRequest logicRequest = getWebApplication().getURLManager() .getLogicRequest(request, response, getServletContext()); request.setCurrentRequest(logicRequest); request.setAttribute("context", logicRequest); final String result = new XyzExecution(logicRequest, this) .execute(); return new Result() { public String getReturnCode() { return result; } public LogicRequest getLogicRequest() { return logicRequest; } }; }}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -