1

I'm trying to map MyHttpHandler to custom url using grizzly 2.3 web server like this (that should be RESTfull url, like /entity/42/attribute):

HttpServer httpServer = HttpServer.createSimpleServer();
ServerConfiguration config = httpServer.getServerConfiguration();
config.addHttpHandler(new MyHttpHandler(), "/entity/*/attribute");

It does not work. How can I do it in grizzly?

Oroboros102
  • 2,214
  • 1
  • 27
  • 41
  • 1
    Looks like no one knows much about grizzly. So, I decided to use netty instead (I know, it's not the same. Netty is more low level). Now I have a primitive routing handler in netty with Patterns, Strings and all I want. – Oroboros102 Aug 22 '14 at 10:35

1 Answers1

1

For version 2.3.17 of grizzly-http-server, I see that addHttpHandler(HttpHandler httpHandler, String... mappings) creates HttpHandlerRegistration instances from the mapping Strings:

ServerConfiguration#addHttpHandler (on grepcode.com)

The Javadoc of the fromString method mentions that "*" wildcards are supported:

HttpHandlerRegistration#fromString (on grepcode.com)

oldo
  • 2,092
  • 1
  • 15
  • 11
  • If you are using Maven you could let your IDE download the sources for the grizzly Maven artifacts and step through the code in the debugger. Maybe there is a bug, or a misunderstanding how the wildcard in the mapping is interpreted. – oldo Feb 13 '15 at 14:20