• 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
 
Happiness is not a goal ... it's a by-product of a life well lived - Eleanor Roosevelt. Tiny ad:
the new thread boost feature: great for the advertiser and smooth for the coderanch user
https://coderanch.com/t/674455/Thread-Boost-feature
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!