Configuring Jetty JSP support in embedded mode in Maven project

前端 未结 6 1455
遥遥无期
遥遥无期 2021-01-30 05:50

I can visit .html pages with Jetty, but when I visit a .jsp page I get:

0 13:21:13 / [INFO] No JSP support. Check that JSP jars are in lib/jsp and th

6条回答
  •  轻奢々
    轻奢々 (楼主)
    2021-01-30 06:30

    After reading this stackoverflow page (nice job) as well as http://wiki.eclipse.org/Jetty/Howto/Configure_JSP, I finally got this to work as well. Since my config is slightly different, I thought I'd contribute back. I have an embedded Jetty 8 installation without the 'javac' compiler, and I got it to work by using the eclipse compiler and setting the system property before creating the server, like this:

    System.setProperty("org.apache.jasper.compiler.disablejsr199", "true");
    Server server = new Server();
    

    And using the following maven configuration:

    
      org.apache.geronimo.specs
      geronimo-servlet_3.0_spec
      1.0
    
    
      org.eclipse.jetty.orbit
      javax.el
      2.2.0.v201108011116
    
    
      org.eclipse.jetty.orbit
      javax.servlet.jsp
      2.2.0.v201112011158
    
    
      org.eclipse.jetty.orbit
      javax.servlet.jsp.jstl
      1.2.0.v201105211821
    
    
      org.eclipse.jetty.orbit
      org.apache.jasper.glassfish
      2.2.2.v201112011158
    
    
      org.eclipse.jetty.orbit
      org.apache.taglibs.standard.glassfish
      1.2.0.v201112081803
    
    
      org.eclipse.jetty.orbit
      org.eclipse.jdt.core
      3.7.1
    
    

提交回复
热议问题