当我尝试此代码时,它会显示错误并停止执行代码。
<?xml version="1.0" encoding="UTF-8"?>
<Context antiJARLocking="true" path="/WebApplication1"/>
<servlet>
<servlet-name>company</servlet-name>
<jsp-file>/companyDashboard.jsp</jsp-file>
</servlet>
<servlet-mapping>
<servlet-name>company</servlet-name>
<url-pattern>/companyDashboard</url-pattern>
</servlet-mapping>
答案 0 :(得分:3)
在web.xml中定义映射
<servlet>
<servlet-name>thejsp</servlet-name>
<jsp-file>/thejsp.jsp</jsp-file>
</servlet>
<servlet-mapping>
<servlet-name>thejsp</servlet-name>
<url-pattern>/thejsp</url-pattern>
</servlet-mapping>