开发者

servlet version getServletContext().getEffectiveMajorVersion() given me 2.5 while i am using 3

i am using tomcat 7.0.11 which also support servlet 3.0 but

req.getServletContext().getEff开发者_如何转开发ectiveMajorVersion() // 2

req.getServletContext().getEffectiveMinorVersion() // 5

gives me this output.

how would i achive servlet 3.0?

it show jsp 2.1 while i expect 2.2 as tomcat support javaServer page 2.2.

and also how would i get JAvaServer Page version?

servlet version getServletContext().getEffectiveMajorVersion() given me 2.5 while i am using 3


Make sure that web.xml specifies Servlets 3.0:

<web-app
    xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
    xmlns="http://java.sun.com/xml/ns/javaee"
    xmlns:web="http://java.sun.com/xml/ns/javaee/web-app_2_5.xsd"
    xsi:schemaLocation="http://java.sun.com/xml/ns/javaee http://java.sun.com/xml/ns/javaee/web-app_3_0.xsd"
    version="3.0">

    <!-- snip -->

</web-app>

To get the version of JSP that you're using, use the javax.servlet.jsp.JspFactory:

 JspFactory.getDefaultFactory().getEngineInfo().getSpecificationVersion();
0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜