Changeset 2598 for vlo/branches/vlo-2.13-param/vlo_webapp/src/main/java/eu/clarin/cmdi/vlo/config/VloConfig.java
- Timestamp:
- 02/20/13 11:36:52 (11 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
vlo/branches/vlo-2.13-param/vlo_webapp/src/main/java/eu/clarin/cmdi/vlo/config/VloConfig.java
r2597 r2598 3 3 import java.io.UnsupportedEncodingException; 4 4 import java.net.URLEncoder; 5 import javax.servlet.GenericServlet;6 5 import javax.servlet.ServletContext; 7 6 import org.simpleframework.xml.Element; … … 89 88 public VloConfig() { 90 89 // let the superclass know about the logger defined here 91 // ConfigFileParam.logger = webAppConfigLogger;92 90 93 91 logger = new WebAppConfigLogger(); … … 100 98 */ 101 99 public static final String CONFIG_FILE = 102 VloConfig.class.getResource("/ WebAppConfig.xml").getFile();100 VloConfig.class.getResource("/VloConfig.xml").getFile(); 103 101 104 102 /** … … 131 129 /** 132 130 * kj: change the annotation. Instead of opening a context, it is now a 133 * matter of initiali sing it. Make a new method for referencing.131 * matter of initializing it. Make a new method for referencing. 134 132 * 135 133 * Open a static context of WebAppConfig members, and assign values to … … 151 149 * @return the web application configuration in a new static context 152 150 */ 153 public static VloConfig setWebApp(ServletContext context) {151 public static VloConfig webApp() { 154 152 if (config == null) { 155 153 // the configuration is not there yet; create it now … … 157 155 } 158 156 159 /** 160 * get the XML file configuration from the file by invoking the 161 * superclass method 162 */ 157 // get the XML file configuration from the file by invoking the 158 163 159 config = (VloConfig) read(config); 164 165 /* Contrary to Simple, the servlet context parameters are not retrieved166 * by annotation. Get them by invoking a local method.167 *168 * Here also invoke a superclass method169 */170 config = addServletContext(config, context);171 160 172 161 return config; … … 177 166 * method. 178 167 * 168 * In this method, exceptions to the normal web application context can 169 * be made. 170 * 179 171 * @return 180 172 */ 181 public static VloConfig WebAppTest() {173 public static VloConfig testWebApp() { 182 174 if (config == null) { 183 175 // the configuration is not there yet; create it now … … 185 177 } 186 178 187 /** 188 * get the XML file configuration from the file by invoking the 189 * superclass method 190 */ 179 // get the XML file configuration from the file by invoking the 180 191 181 config = (VloConfig) read(config); 192 182 … … 607 597 608 598 /** 599 * 600 * kj: repair annotation 601 * 602 * Contrary to Simple, the web application's context parameters are not 603 * retrieved by annotation. Get them by invoking a local method. 604 * 609 605 * Add properties of the {@literal servlet's} context<br><br> 610 * 606 * 611 607 * Keep the properties in the static context of the WebAppConfig class, next 612 608 * to the members representing the values in WebAppConfig.xml file.<br><br> … … 616 612 * @return the static WebAppConfig member 617 613 */ 618 static VloConfig addServletContext(VloConfig config, ServletContext context) {614 public static VloConfig addServletContext(VloConfig config, ServletContext context) { 619 615 620 616 // retrieve parameter valies from the servlet context
Note: See TracChangeset
for help on using the changeset viewer.