Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- +OLPlugin
- +src
- +com.openlayers.action
- -OpenLayersConfigAction.java
- -openlayersplugin.properties
- -struts-plugin.xml
- -struts.xml
- +lib
- -asm-commons-3.3.jar
- -asm-3.3.jar
- -commons-fileupload-1.3.2.jar
- -commons.io-2.4.jar
- -commons-lang3-3.4.jar
- -commons-logging-1.1.3.jar
- -freemarker-2.3.23.jar
- -javaassist-3.20.0-GA.jar
- -log4j-api-2.3.jar
- -log4j-core-2.3.jar
- -ognl-3.1.10.jar
- -struts2-convention-plugin-2.5.2.jar
- -struts2-core-2.5.2.jar
- -struts2-json-plugin-2.5.2.jar
- +web.xml
- <?xmlversion="1.0"encoding="UTF-8"?>
- <web-appxmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"xmlns="http://java.sun.com/xml/ns/javaee"xsi:schemaLocation="http://java.sun.com/xml/ns/javaeehttp://java.sun.com/xml/ns/javaee/web-app_3_0.xsd"id="WebApp_ID"version="3.0">
- <display-name>OLPlugin</display-name>
- <filter>
- <filter-name>struts2</filter-name>
- <filter-class>org.apache.struts2.dispatcher.filter.StrutsPrepareAndExecuteFilter</filter-class>
- </filter>
- <filter-mapping>
- <filter-name>struts2</filter-name>
- <url-pattern>/*</url-pattern>
- </filter-mapping>
- <welcome-file-list>
- <welcome-file>index.jsp</welcome-file>
- </welcome-file-list>
- </web-app>
- +struts-plugin.xml
- <?xmlversion="1.0"encoding="UTF-8"?>
- <!DOCTYPEstrutsPUBLIC
- "-//ApacheSoftwareFoundation//DTDStrutsConfiguration2.0//EN"
- "http://struts.apache.org/dtds/struts-2.0.dtd">
- <struts>
- <constantname="struts.devMode"value="true"/>
- <constantname="struts.custom.i18n.resources"value="openlayersplugin"/>
- <packagename="olplugin"extends="struts-default,json-default"namespace="/openlayersplugin">
- <actionname="getconfiguration"class="com.openlayers.action.OpenLayersConfigAction"method="getconfiguration">
- <resultname="success"type="json"/>
- </action>
- </package>
- </struts>
- +struts.xml
- <?xmlversion="1.0"encoding="UTF-8"?>
- <!DOCTYPEstrutsPUBLIC
- "-//ApacheSoftwareFoundation//DTDStrutsConfiguration2.0//EN"
- "http://struts.apache.org/dtds/struts-2.0.dtd">
- <struts>
- <includefile="/struts-plugin.xml"></include>
- </struts>
- +OpenLayersConfigAction.java
- packagecom.openlayers.action;
- importjava.io.IOException;
- importjava.util.LinkedHashMap;
- importjava.util.Map;
- importjava.util.Properties;
- importcom.opensymphony.xwork2.ActionSupport;
- publicclassOpenLayersConfigActionextendsActionSupport{
- privatestaticfinallongserialVersionUID=1L;
- privateMap<String,Object>response=newLinkedHashMap<String,Object>();
- privatestaticPropertiesprop=newProperties();
- privateString[]request;
- static{
- try{
- prop.load(OpenLayersConfigAction.class.getClassLoader().getResourceAsStream("com/openlayers/action/openlayersplugin.properties"));
- }
- catch(IOExceptione){
- prop.clear();
- System.err.println("Unabletoloadopenlayerspluginpropertiesfile");
- e.printStackTrace();
- }
- }
- publicStringgetconfiguration(){
- try{
- response.clear();
- if(getRequest()!=null&&prop.size()>0){
- for(Stringkey:getRequest()){
- response.put(key,prop.getProperty(key));
- }
- }
- }
- catch(Exceptione){
- e.printStackTrace();
- }
- returnSUCCESS;
- }
- publicMap<String,Object>getResponse(){
- returnresponse;
- }
- privateString[]getRequest(){
- returnrequest;
- }
- publicvoidsetRequest(String[]request){
- this.request=request;
- }
- }
- +openlayersplugin.properties
- GEOSERVER_HOST=localhost
- GEOSERVER_PORT=8080
- GEOSERVER_CONTEXT_PATH=geoserver
- GEOSERVER_USERNAME=admin
- GEOSERVER_PASSWORD=geoserver
- GEOSERVER_WORKSPACE=INDIA
- GEOSERVER_STORE=INDIA_SHAPE_DATA
- DEFAULT_ZOOM_LEVEL=5
- DEFAULT_LAT=23.621878
- DEFAULT_LON=80.375977
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement