Dynamic Web Module option in Eclipse

前端 未结 2 604
鱼传尺愫
鱼传尺愫 2021-02-02 12:59

Could someone please explain the purpose of this option and what exactly it is for.

It looks like the default is on my eclipse installation is 3.0 but it wont run on a

相关标签:
2条回答
  • 2021-02-02 13:39

    The below are the jdk requirement for servlet API.

    Please find the compatibilty.

    Servlet 4.0     Java EE 8   
    
    Servlet 3.1     Java EE 7   
    
    Servlet 3.0     Java EE 6, Java SE 6
    
    Servlet 2.5     Java EE 5, Java SE 5
    
    Servlet 2.4     J2EE 1.4, J2SE 1.3  
    
    Servlet 2.3     J2EE 1.3, J2SE 1.2  
    
    Servlet 2.2     J2EE 1.2, J2SE 1.2  
    

    I think this will helpful for you.. :)

    Thanks

    0 讨论(0)
  • 2021-02-02 13:50

    That version correlates with Servlet API version. Servlet 3.0 (released at december 2009 as part of Java EE 6) runs on Servlet 3.0 containers only (Tomcat 7, Glassfish 3, JBoss AS 6, etc). Servlet 2.5 (released at 11 may 2006 as part of Java EE 5) runs on Servlet 2.5 containers only or newer (Tomcat 6, Glassfish 2, JBoss AS 5, etc). Servlet 2.4 (released at november 2003 as part of J2EE 1.4) runs on Servlet 2.4 containers only or newer, etcetera.

    You just need to pick the right API version whatever you want to implement your webapp in. Or if you don't have the freedom in picking the servlet container used, then pick the API which suits the servlet container version the best.

    As to why the JDK defaults to one or other, it's just the minimum JDK requirement of the Servlet API version in question. Often, when you're picking an older Servlet API, in reality the JRE/JDK used is also that old.

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