- Timestamp:
- 2016-04-24T14:45:00+12:00 (8 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
main/trunk/greenstone3/src/java/org/greenstone/gsdl3/core/URLFilter.java
r30482 r30483 126 126 } 127 127 128 //MessageRouter gsRouter = (MessageRouter) request.getServletContext().getAttribute("GSRouter");129 // The above line didn't work in i-jetty (failed to find class)130 // (See node below about ServletContext for more details)131 // // Changed to the following (but hasn't been exhaustively tested)132 128 MessageRouter gsRouter = (MessageRouter) context.getAttribute("GSRouter"); 133 129 … … 205 201 } 206 202 else if (url.contains(INTERFACE_PATH)) 207 { 208 ////String fileURL = url.replaceFirst(request.getServletContext().getContextPath(), ""); 209 // 210 // The above line was changed to the line below to work on i-jetty. The above caused 211 // an exception to be thrown trying to load in the class at init time: 212 // javax.servlet.http.ServletContext 213 // 214 // And then later in the life-time the servlet, the above line fails when run 215 // The following (older) way to do this was found to work as a replacment 216 203 { 217 204 String fileURL = url.replaceFirst(context.getContextPath(), ""); 218 219 // A different theory is that the problem could be to do with version of Servlet220 // Container implemented by the web-server:221 // http://stackoverflow.com/questions/7860782/request-getservletcontext-not-found-even-with-new-jar222 223 // Similar change in the following needed also ...224 225 // Replacement line known to be deprecated, but very useful for us to use in this situation226 //227 // If this method is every offically removed, and the newer getServletContext()228 // still can't be relied upon to work in all web servers Greenstone uses,229 // then an alternative approach would be to get the core information (servlet context name,230 // and where it is on the file system) from the gsdl properties file231 232 ////File requestedFile = new File(request.getServletContext().getRealPath(fileURL));233 205 File requestedFile = new File(context.getRealPath(fileURL)); 206 234 207 if (!requestedFile.exists()) 235 208 {
Note:
See TracChangeset
for help on using the changeset viewer.