This week's book giveaway is in the Agile and Other Processes forum.
We're giving away four copies of The Little Book of Impediments (e-book only) and have Tom Perry on-line!
See this thread for details.
Win a copy of The Little Book of Impediments (e-book only) this week in the Agile and Other Processes forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

test/*.jsp not a valid url-pattern!

 
Poonam Agarwal
Ranch Hand
Posts: 324
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
A web.xml contains the following element:

<servlet-mapping>
<servlet-name>xyz</servlet-name>
<url-pattern>*Insert code here*</url-pattern>
</servlet-mapping>

Which of the following url-patterns can be put in place of *Insert code here*?

1. *.*
2. /*.*
3. test/*.jsp
4. None of these.

the correct option is 1. That means option 3 is wrong, we cannot mix the url-pattern together ? Am i right

moreover if while option is correct I guess it works for the all the request??

please correct me if I am wrong
 
Ankit Garg
Sheriff
Posts: 9580
33
Android Google Web Toolkit Hibernate IntelliJ IDE Java Spring
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
3rd option is wrong because URL pattern must begin by either / or *. it cannot start with a character. Also I tried this in netbeans and it gives an error for the first pattern also saying that pattern contains to asterisks which is not allowed but I'm not sure about that...
 
Amit Hetawal
Ranch Hand
Posts: 48
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I think the correct answer should be option 4.
I tried all the other options they dont work for me, and also when i read the HFSJ Page 618. It just gives the url pattern should be
*.do
/anycharcter/*
/anychar.do

Am still a novice, please correct me if i am wrong.

Thanks,
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic