mvc-api icon indicating copy to clipboard operation
mvc-api copied to clipboard

Support multi ApplicationPaths

Open hantsy opened this issue 4 years ago • 3 comments

If I mixed Jaxrs and MVC in the same application, I hope the application paths can be declared respectively and also allow apply different config(default media type, and external security config etc) on both application paths.

eg. /api for RESTful APIs.

  • default media type set to application/json
  • use jwt stateless auth.

/web for MVC web pages.

  • default media type is text/html
  • use a form based login, and enable session for loggined user.

hantsy avatar Mar 03 '21 11:03 hantsy

What you can currently do to achieve this is to use two Application classes. In this case you can declare separate paths for each application. But the downside is that you cannot use resource/provider auto-discovery and instead have to implement Application#getClasses() to assign resources/controllers/providers to the correct application.

chkal avatar Mar 06 '21 14:03 chkal

@chkal Thanks. I have not tried it before, will check it.

hantsy avatar Mar 07 '21 04:03 hantsy

Looks like Jakarta REST will standardize this in their 4.0 release

ivargrimstad avatar May 23 '21 11:05 ivargrimstad