listhandler.java
来自「《Java网络程序设计.rar》包括三个网络程序的源代码。」· Java 代码 · 共 40 行
JAVA
40 行
/* */package org.impact.stars.control.web.handlers;import org.impact.stars.control.event.StarsEvent;import org.impact.stars.control.exceptions.StarsEventException;import javax.servlet.http.HttpServletRequest;import javax.servlet.http.HttpSession;import java.util.Enumeration;/* * ListHandler * ----------- * This handler takes all the parameters and their values in the request * object and sets them as attributes in the session object for use by * the list tag handlers. */public class ListHandler extends RequestHandlerSupport { public StarsEvent processRequest(HttpServletRequest request) throws StarsEventException { Enumeration paramNames = request.getParameterNames(); HttpSession session = request.getSession(); while (paramNames.hasMoreElements()) { String paramName = (String) paramNames.nextElement(); session.setAttribute(paramName, request.getParameter(paramName)); } return null; }}
⌨️ 快捷键说明
复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?