你的顺序好像不对,在servlet2.3中定义这些标签是有顺序的!你把:
<resource-ref>
<description>DB Connection</description>
<res-ref-name>jdbc/tatchunJNDI</res-ref-name>
<res-type>javax.sql.DataSource</res-type>
<res-auth>Container</res-auth>
</resource-ref>
<resource-ref>
<description>mail session</description>
<res-ref-name>mail/tatchunMail</res-ref-name>
<res-type>javax.mail.Session</res-type>
<res-auth>Container</res-auth>
</resource-ref>
放到:<servlet-mapping>
<servlet-name>Test</servlet-name>
<url-pattern>/Test</url-pattern>
</servlet-mapping>
之后试试看看
<resource-ref>
<description>DB Connection</description>
<res-ref-name>jdbc/tatchunJNDI</res-ref-name>
<res-type>javax.sql.DataSource</res-type>
<res-auth>Container</res-auth>
</resource-ref>
<resource-ref>
<description>mail session</description>
<res-ref-name>mail/tatchunMail</res-ref-name>
<res-type>javax.mail.Session</res-type>
<res-auth>Container</res-auth>
</resource-ref>
放到:<servlet-mapping>
<servlet-name>Test</servlet-name>
<url-pattern>/Test</url-pattern>
</servlet-mapping>
之后试试看看
能不能请问一下在哪里可以看到“在servlet2.3中定义这些标签是有顺序的”的说明?
谢谢
把<resource-ref>放到<servlet>
和<servlet-mapping>之后试试!
但是我最近看Jakarta struts
上边说,在web-app语法中,servlet在servlet-mapping之前,而taglib必须在servlet-mapping之后
应该web-app的语法是按照这里的dtd来校验的
而在servlet2.4中不使用DTD校验,而使用xml-schema