Dave
Dave

Reputation: 6189

Defining servlet url patterns using regular expressions on Google App Engine platform

I'm working in google app engine and I'm attempting to set up my servlets like this:

/action_X/someIdString_32joi32joifj32

Would go to one servlet, while...

/action_X/subAction_A/someIdString_wjiefoapjfew

would go to another servlet, specifically written to handle subAction_A

How can I define this in my web.xml to make this happen? I've found some stuff on google using the url-regexp, but that doesn't really look like its supported anymore, or at least not on the platform I'm using (Google App Engine, Web Application Project from Eclipse plugin).

Any suggestions on how to do this in Google App Engine? I can't seem to find a clean way to do this without having to write the code myself to parse out the url. Should I just make one servlet, map everything to that, and then do rewriting myself?

Upvotes: 0

Views: 1698

Answers (1)

Bozho
Bozho

Reputation: 597372

You can't. The servlet url mapping support is very limited. You can:

  • use UrlRewriteFilter
  • use spring-mvc (or another action web framework) to define controller method patterns
  • provide the parsing logic yourself, if it's simple and it is just an individual case

Upvotes: 3

Related Questions