• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Web.xml and Url-mapping.

 
Henrik Krievs
Ranch Hand
Posts: 60
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Studying for SCWCD, I'm on the partwith url mapping.

It doesn't seem that you can combine extension mappings and path mappings ?

Eg.

<servlet-mapping>
<servlet-name>Servlet1</servlet-name>
<url-pattern>/MyApp/Myservlet1/*.jsp</url-pattern>
</servlet-mapping>

<servlet-mapping>
<servlet-name>Servlet2</servlet-name>
<url-pattern>/MyApp/Myservlet1/*.someotherextension</url-pattern>
</servlet-mapping>
 
Anthony Watson
Ranch Hand
Posts: 327
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
You can't combine extension mappings with path mappings, as you said. However, you could get this same functionality if you just put all of your files with the same extension in a subfolder.

So, instead of

/myGenericFolder/*.jsp

You could use

/myGenericFolder/myJSPs/*
 
Leena Diwan
Ranch Hand
Posts: 351
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Very good solution!

Leena
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic