uriaction.java
来自「基于struct结构的jsp」· Java 代码 · 共 37 行
JAVA
37 行
package com.ntsky.bbs.action;import org.apache.struts.action.*;import javax.servlet.http.*;import org.apache.log4j.Logger ;/** * <p>Title: Ntsky OpenSource BBS</p> * <p>Description: 页面跳转</p> * <p>Copyright: Copyright (c) 2004</p> * <p>Company: WWW.FM880.COM</p> * @author 姚君林 * @version 1.0 */public class URIAction extends Action { private final static Logger logger = Logger.getLogger(URIAction.class); public ActionForward execute(ActionMapping actionMapping, ActionForm actionForm, HttpServletRequest httpServletRequest, HttpServletResponse httpServletResponse) throws Exception{ /**@todo: complete the business logic here, this is just a skeleton.*/ HttpSession session = httpServletRequest.getSession(); String uri = (String)session.getAttribute("uri"); logger.info("用户当前的URI为 : " + uri); if(uri==null){ /** * 跳转到首页 */ return actionMapping.findForward("index"); } else{ session.removeAttribute("uri"); httpServletRequest.removeAttribute("uri"); httpServletRequest.setAttribute("uri",uri); return actionMapping.findForward("uri"); } //throw new java.lang.UnsupportedOperationException("Method perform() not yet implemented."); }}
⌨️ 快捷键说明
复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?