Win a copy of Java Mock Exams (software) this week in the Programmer Certification (OCPJP) forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic

problem using '?' in url-pattern

 
Chandra Sagi
Ranch Hand
Posts: 162
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi Ranchers,

I have a URL with a '?' symbol in it, which I wanted to map to different url using sendRedirect in a servlet. When I give the url with '?' symbol in url-pattern tag of a servlet-mapping it doesn't take it. Does the symbol has a different meaning like as in regex? Please let me know how to solve this problem.

Thanks in Advance,

Cheers,
Chandu
 
Flom Xanther
Ranch Hand
Posts: 48
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
you can't use regex in url-pattern!

only wildcard id "*" at the least position or at the first - for extension mapping.

mfg,
Flom
 
Chandra Sagi
Ranch Hand
Posts: 162
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
How could I map an url with '?' symbol in it.

Thanks!
 
Shivani Chandna
Ranch Hand
Posts: 380
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
You could try
/? or /?/ or /?*.jsp

But since ? does not have any meaning attached to it, I fail to understand why do you wish to use "?" for url-pattern?
 
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!