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

📄 configrequests.java

📁 电子地图服务器,搭建自己的地图服务
💻 JAVA
字号:
/* Copyright (c) 2001 - 2007 TOPP - www.openplans.org.  All rights reserved.
 * This code is licensed under the GPL 2.0 license, availible at the root
 * application directory.
 */

/* Copyright (c) 2001 - 2007 TOPP - www.openplans.org.  All rights reserved.
 * This code is licensed under the GPL 2.0 license, availible at the root
 * application directory.
 */
package org.vfny.geoserver.config;

import javax.servlet.ServletContext;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpSession;


/**
 * Utility methods for locatating Config classes in the Servlet context.
 *
 * <p>
 * Called by ActionForms to lookup things in the WebContainer for the JSP page.
 * Similar to the Requests utility classes.
 * </p>
 *
 * <p>
 * These methods need to be kept in lockstep with the ConfigAction convience
 * methods.
 * </p>
 *
 * @author jgarnett, Refractions Research, Inc.
 * @author $Author: jive $ (last modification)
 * @version $Id: ConfigRequests.java 6326 2007-03-15 18:36:40Z jdeolive $
 */
public class ConfigRequests {
    /**
     * Access Web Map Server Configuration Model from the WebContainer.
     *
     * <p>
     * Note that this represents the Configuration and not the state of the Web
     * Feature Server.
     * </p>
     *
     * @param request DOCUMENT ME!
     *
     * @return Configuration information for the Web Map Server
     */

    //JD: kill this
    //    public static WMSConfig getWMSConfig(HttpServletRequest request) {
    //        HttpSession session = request.getSession();
    //        ServletContext context = session.getServletContext();
    //
    //        return (WMSConfig) context.getAttribute(WMSConfig.CONFIG_KEY);
    //    }

    /**
     * Access Web Feature Server Configuration Model from the WebContainer.
     *
     * <p>
     * Note that this represents the Configuration and not the state of the Web
     * Feature Server.
     * </p>
     *
     * @param request DOCUMENT ME!
     *
     * @return Configuration information for Web Feature Server
     */

    //	JD: kill this
    //    public static WFSConfig getWFSConfig(HttpServletRequest request) {
    //        HttpSession session = request.getSession();
    //        ServletContext context = session.getServletContext();
    //
    //        return (WFSConfig) context.getAttribute(WFSConfig.CONFIG_KEY);
    //    }

    /**
     * Access Web Map Server Configuration Model from the WebContainer.
     *
     * @param request DOCUMENT ME!
     *
     * @return Configuration model for Global information.
     */
    public static GlobalConfig getGlobalConfig(HttpServletRequest request) {
        HttpSession session = request.getSession();
        ServletContext context = session.getServletContext();

        return (GlobalConfig) context.getAttribute(GlobalConfig.CONFIG_KEY);
    }

    /**
     * Access Catalog Configuration Model from the WebContainer.
     *
     * @param request DOCUMENT ME!
     *
     * @return Configuration model for Catalog information.
     */
    public static DataConfig getDataConfig(HttpServletRequest request) {
        HttpSession session = request.getSession();
        ServletContext context = session.getServletContext();

        return (DataConfig) context.getAttribute(DataConfig.CONFIG_KEY);
    }
}

⌨️ 快捷键说明

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