コード例 #1
0
ファイル: Controller.java プロジェクト: maoyuanchen/jfinal
 /** Forward to an action */
 public void forwardAction(String actionUrl) {
   if (setFlashFalg) { // 若有新加入的Flash。更换key。
     String actionPath = this.request.getRequestURI();
     // 将以当前actionPath为key更替为下一个请求actionPath作为key
     flashManager.updateFlashKey(this.getSession(false), actionPath, actionUrl);
     setFlashFalg = false;
   }
   render = new ActionRender(actionUrl);
 }
コード例 #2
0
ファイル: Controller.java プロジェクト: maoyuanchen/jfinal
 /** Redirect to url */
 public void redirect(String url, boolean withQueryString) {
   if (setFlashFalg) {
     String actionPath = this.request.getRequestURI();
     String newActionPath = parsePath(actionPath, url);
     flashManager.updateFlashKey(this.getSession(false), actionPath, newActionPath);
     setFlashFalg = false;
   }
   render = renderFactory.getRedirectRender(url, withQueryString);
 }
コード例 #3
0
ファイル: Controller.java プロジェクト: maoyuanchen/jfinal
 /**
  * 设定Flash,该flash中的所有信息将会出现在下一个请求中。 该操作一般用在forwardAction 及redirect操作前。
  * 在设定Falsh拦截器后,拦截器会自动注入所有当前Action中设定的Flash信息到request中。 且仅注入一次。
  *
  * @param key 键
  * @param value 值
  */
 public void setFlash(String key, Object value) {
   String actionPath = this.request.getRequestURI();
   flashManager.setFlash(this.getSession(false), actionPath, key, value);
   setFlashFalg = true;
 }