⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 editsubscription.gv

📁 struts框架的script版本. 用于学习strust框架
💻 GV
字号:
import java.lang.reflect.InvocationTargetException;import org.apache.commons.beanutils.PropertyUtils;import org.apache.struts.webapp.example.*;import javax.servlet.ServletException;act = request.getParameter("action");if (act == null) {    act = "Create";}host = request.getParameter("host");if (log.isDebugEnabled()) {    log.debug("EditSubscriptionAction:  Processing " + act +              " action");}// Is there a currently logged on user?user = (User) session.getAttribute(Constants.USER_KEY);if (user == null) {    if (log.isTraceEnabled()) {        log.trace(" User is not logged on in session "                  + session.getId());    }    struts.setForwardName("logon");    return;}// Identify the relevant subscriptionsubscription =        user.findSubscription(request.getParameter("host"));if ((subscription == null) && !act.equals("Create")) {    if (log.isTraceEnabled()) {        log.trace(" No subscription for user " +                  user.getUsername() + " and host " + host);    }    struts.setForwardName("failure");    return;}if (subscription != null) {    session.setAttribute(Constants.SUBSCRIPTION_KEY, subscription);}form = struts.form;form.setAction(act);if (!act.equals("Create")) {    if (log.isTraceEnabled()) {        log.trace(" Populating form from " + subscription);    }    try {        PropertyUtils.copyProperties(form, subscription);        form.setAction(act);    } catch (InvocationTargetException e) {        Throwable t = e.getTargetException();        if (t == null)            t = e;        log.error("SubscriptionForm.populate", t);        throw new ServletException("SubscriptionForm.populate", t);    } catch (Throwable t) {        log.error("SubscriptionForm.populate", t);        throw new ServletException("SubscriptionForm.populate", t);    }}// Forward control to the edit subscription pageif (log.isTraceEnabled()) {    log.trace(" Forwarding to 'success' page");}struts.setForwardName("success");

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -