📄 abstractprocessingcommand.java
字号:
package message_board;
import java.io.IOException;
import javax.servlet.RequestDispatcher;
import javax.servlet.ServletException;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
/**
* AbstractProcessingCommand
*/
public abstract class AbstractProcessingCommand implements ProcessingCommand
{
public abstract void execute(HttpServletRequest request, HttpServletResponse response,
String action) throws ServletException, IOException;
public final boolean isValidString(String input)
{
return ((input != null) && (input.length() > 0));
}
public final void performRedirect(String path, HttpServletRequest request,
HttpServletResponse response) throws ServletException, IOException
{
if (path != null)
{
request.setAttribute("SERVLET_PATH", request.getContextPath()
+ request.getServletPath());
RequestDispatcher dispatch = request.getRequestDispatcher(path);
dispatch.forward(request, response);
}
}
}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -