Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Provide annotation based alternative to AbstractAnnotationConfigDispatcherServletInitializer [SPR-10359] #14991

Closed
spring-projects-issues opened this issue Mar 7, 2013 · 1 comment
Labels
in: web Issues in web modules (web, webmvc, webflux, websocket) status: bulk-closed An outdated, unresolved issue that's closed in bulk as part of a cleaning process

Comments

@spring-projects-issues
Copy link
Collaborator

Oliver Drotbohm opened SPR-10359 and commented

Most of the WebApplicationInititalizer implementations based on AbstractAnnotationConfigDispatcherServletInitializer look like this:

public class MyWebApplicationInitializer extends AbstractAnnotationConfigDispatcherServletInitializer {

  @Override
  protected Class<?>[] getRootConfigClasses() {
    return new Class<?>[] { ApplicationConfig.class };
  }

  @Override
  protected Class<?>[] getServletConfigClasses() {
    return new Class<?>[] { WebConfig.class };
  }

  @Override
  protected String[] getServletMappings() {
    return new String[] { "/" };
  }
}

It would be cool if this could be boiled down to this:

@InitWebApplication(
  rootConfig = ApplicationConfig.class,
  webConfig = WebConfig.class,
  mapping = "/")
public abstract class MyWebApplicationInitializer implements WebApplicationInitializer { }

Alternatively we could introduce annotations to mark configuration classes directly:

public abstract class MyWebApplicationInitializer implements WebApplicationInitializer {

  @RootContext
  public static class ApplicationConfig { … }

  @WebContext
  public static class WebConfig { … }
}

The latter probably has the issue of ordering as looking up the static classes probably does not return them in a predefined order (in case there are multiple ones defined to get into the @WebContext. Also the servlet mapping definition does not fit into this model nicely. I just thought to document it as a slightly less usable alternative.


No further details from SPR-10359

@spring-projects-issues spring-projects-issues added status: waiting-for-triage An issue we've not yet triaged or decided on type: enhancement A general enhancement in: web Issues in web modules (web, webmvc, webflux, websocket) and removed type: enhancement A general enhancement labels Jan 11, 2019
@rstoyanchev rstoyanchev added status: bulk-closed An outdated, unresolved issue that's closed in bulk as part of a cleaning process and removed status: waiting-for-triage An issue we've not yet triaged or decided on labels Jan 11, 2019
@spring-projects-issues
Copy link
Collaborator Author

Bulk closing outdated, unresolved issues. Please, reopen if still relevant.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
in: web Issues in web modules (web, webmvc, webflux, websocket) status: bulk-closed An outdated, unresolved issue that's closed in bulk as part of a cleaning process
Projects
None yet
Development

No branches or pull requests

2 participants