Forum Stats

  • 3,838,749 Users
  • 2,262,397 Discussions
  • 7,900,750 Comments

Discussions

servlet-mapping subdirectory 404

bm13
bm13 Member Posts: 1
edited Jan 28, 2019 12:49PM in Java Servlet

Hi,

I set up a simple WebServices Project with IntelliJ using Glassfish.
If I'm mapping my simple Controller class (via the web.xml) directly to

<servlet-mapping>

   <servlet-name>Controller</servlet-name>

   <url-pattern>/controller</url-pattern>

</servlet-mapping>

everything works fine. But as soon as I use a subdirectory like

<servlet-mapping>

   <servlet-name>Controller</servlet-name>

   <url-pattern>/classes/controller</url-pattern>

</servlet-mapping>

, I can't access it and get 404.

Do I somehow have to admit the right to use subdirectories in the url? or why do I get a 404?

Thanks,

bm13