开发者

Servlet URL mapping creating problem

I'm unable to identify the problem, I've t开发者_运维技巧he following URL Pattern for opening the report servlet,

<servlet>
    <servlet-name>ReportFile</servlet-name>
    <servlet-class>web.servlet.ReportFile</servlet-class>
</servlet>

<servlet-mapping>
    <servlet-name>ReportFile</servlet-name>
    <url-pattern>/Servlets/ReportFile</url-pattern>
</servlet-mapping>

which is working if I open it directly under context that is if I open it as: context/ReportFile, it works, but when I write context/Servlets/ReportFile, It says page not found? What can be the issue? I just want to define URL so that I can apply security on that URL pattern. Any ideas? What am I missing?


I just tried the following mapping in my application and it worked perfectly fine on tomcat:

<servlet-mapping>
      <servlet-name>search</servlet-name>
      <url-pattern>/Servlets/search/*</url-pattern>
</servlet-mapping>

Have you tried adding the trailing /* ?

0

上一篇:

下一篇:

精彩评论

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

最新问答

问答排行榜