我在做Web的应用程序。 我有一个问题,当我修改数据
我想创建水木清华这样的
我希望你能帮助我找到办法做到这一点。 我发现下一个变种,但我不知道,因为人们通常这样做。
- 乘提交的一种形式。
- 1个多提交一个表单。
- 以上则在1 JSP一种形式
我should't使用任何框架。 而如果没有的JavaScript。
谢谢
OK,如果它有助于了解我想对我的servlet显示selvlet的某些部分
protected void processRequest(HttpServletRequest request, HttpServletResponse response)
throws ServletException, IOException {
request.setCharacterEncoding("UTF-8");
response.setCharacterEncoding("UTF-8");
String page = new String();
Command command = CommandFactory.getCommand(request);
page = command.execute(request);
if (page != null) {
RequestDispatcher dispatcher =
getServletContext().getRequestDispatcher(page);
dispatcher.forward(request, response);
}
....
}
和的CommandFactory
public static Command getCommand(HttpServletRequest request){
Command current = new NoCommand();
String action = request.getParameter("command");
if(action == null || action.isEmpty()){
return current;
}
try{
CommandEnum currentState = CommandEnum.valueOf(action.toUpperCase());
current = currentState.getCurrentCommand();
}
...
}
和CommandEnum
public enum CommandEnum {
EDIT_QUESTION {
{
this.command = new EditQuestionCommand();
}
};
}
而在特定的命令我做一些业务逻辑
请帮我找到JSP值的方式越来越为命令=“删除”。 随着单提交我使用隐藏域。 我们如何能为几个按钮,这样做?