diff --git a/src/fr/devinsy/kiss4web/SimpleServletDispatcher.java b/src/fr/devinsy/kiss4web/SimpleServletDispatcher.java index 5df2161..b1a691b 100644 --- a/src/fr/devinsy/kiss4web/SimpleServletDispatcher.java +++ b/src/fr/devinsy/kiss4web/SimpleServletDispatcher.java @@ -6,12 +6,20 @@ package fr.devinsy.kiss4web; -import java.io.*; -import javax.servlet.*; -import javax.servlet.http.*; +import java.io.File; +import java.io.FileInputStream; +import java.io.IOException; +import java.io.PrintWriter; + +import javax.servlet.ServletException; +import javax.servlet.ServletOutputStream; +import javax.servlet.http.HttpServlet; +import javax.servlet.http.HttpServletRequest; +import javax.servlet.http.HttpServletResponse; + + -import fr.devinsy.hico.Hico; import fr.devinsy.util.StringConcatenator; @@ -299,7 +307,7 @@ public class SimpleServletDispatcher extends HttpServlet if ((!path.endsWith("/")) && (!path.endsWith(".xhtml"))) { - path = Hico.instance().webRootPath() + request.getRequestURI(); + path = getServletContext ().getRealPath("/") + request.getRequestURI(); returnInlineFile(response, new File(path), getServletContext().getMimeType(path)); logger.info("File returned directly [" + path + "] with mimetype [" + getServletContext().getMimeType(path) + "].");