Netbeans will not treat JSP as Source Level 7

后端 未结 1 1623
眼角桃花
眼角桃花 2021-01-06 10:29

I\'m trying to run a .jsp page I made and keep encountering this error:

type Exception report

message Internal Server Error

1条回答
  •  孤独总比滥情好
    2021-01-06 11:17

    In my opinion this has nothing to do with Netbeans, but rather with the application server in use. Is suspect you're using Glassfish or Tomcat as they are bundled together with Netbeans 7.

    I had the same problem with Apache Tomcat and it boiled down to that Tomcat (Apache Jasper library) is using Java 1.6 for JSP compilation by default. You'll have to change the default configuration of the JSP servlet in web.xml. I added the following lines to the application's web.xml, note the two parameters compilerSourceVM and compilerTargetVM:

    
    
        jsp
        org.apache.jasper.servlet.JspServlet
        
            fork
            false
        
        
            xpoweredBy
            false
        
        
            compilerSourceVM
            1.7
        
        
            compilerTargetVM
            1.7
        
        3
    
    
    
    
        jsp
        *.jsp
        *.jspx
    
    

    0 讨论(0)
提交回复
热议问题