| | |
| | | import java.net.URLDecoder; |
| | | import java.util.logging.Logger; |
| | | import javax.servlet.ServletException; |
| | | import javax.servlet.http.HttpServlet; |
| | | import javax.servlet.http.HttpServletRequest; |
| | | import javax.servlet.http.HttpServletResponse; |
| | | import net.coobird.thumbnailator.Thumbnails; |
| | | import org.apache.catalina.servlets.DefaultServlet; |
| | | |
| | | /** |
| | | * Mit dem TNServlet kann für eine Bilddatei eine |
| | |
| | | * Unterstuetzt werden die Varianten |
| | | * 120 (_tn), 240 (_kl), 500 (_dd), 700 (_mt), 1200 (_gr) |
| | | */ |
| | | public class TNServlet extends DefaultServlet { |
| | | public class TNServlet extends HttpServlet { |
| | | |
| | | private static final Logger logger = Logger.getLogger(TNServlet.class.getName()); |
| | | |
| | |
| | | // --- Logausgabe Ende |
| | | |
| | | if(uriStr.endsWith(JPG) || uriStr.endsWith(JPEG) || uriStr.endsWith(PNG)) { |
| | | File dir = new File(request.getServletContext().getRealPath("/")); |
| | | File dir = new File(request.getSession().getServletContext().getRealPath("/")); |
| | | String suburiStr = uriStr.substring(request.getContextPath().length()); |
| | | File imgfile = new File(dir, suburiStr); |
| | | if(uriStr.contains(TN)) { |