📄 e0910d6f550f001d1c51f448239bba88
字号:
/*******************************************************************************
* Copyright (c) 2005 Eteration A.S. and others. All rights reserved. This
* program and the accompanying materials are made available under the terms of
* the Eclipse Public License v1.0 which accompanies this distribution, and is
* available at http://www.eclipse.org/legal/epl-v10.html
*
* Contributors: Eteration A.S. - initial API and implementation
******************************************************************************/
package com.lib.web.struts.action;
import java.io.IOException;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import javax.servlet.ServletException;
import org.apache.struts.action.Action;
import org.apache.struts.action.ActionForm;
import org.apache.struts.action.ActionForward;
import org.apache.struts.action.ActionMapping;
import com.lib.biz.XMLOperate;
import com.lib.cls.Server;
import com.lib.web.struts.form.ServerForm;
public class ServerAddAction extends Action {
public ActionForward execute(ActionMapping mapping,
ActionForm form,
HttpServletRequest request,
HttpServletResponse response)
throws IOException, ServletException {
String target = "success";
ServerForm sf = (ServerForm)form;
Server server = sf.getServer();
String path="../../lib/data/libserver.xml";
System.out.println(path);
try {
XMLOperate.getInstance().AddXML(path, server);
} catch (Exception e) {
target = "errors";
return mapping.findForward(target);
}
return mapping.findForward(target);
}
}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -