开发者

Servlet URL mapping creating problem

开发者 https://www.devze.com 2023-02-24 06:16 出处:网络
I\'m unable to identify the problem, I\'ve t开发者_运维技巧he following URL Pattern for opening the report servlet,

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

精彩评论

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