Skip to content

Adds a MVC parameter annotation and a HandlerMethodArgumentResolver to enable decoding Base64 encoded URL parameters.

License

Notifications You must be signed in to change notification settings

Scout24/spring-base64-url-decoder

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

48 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Spring Base64 Url Decoder

Build Status Coverage Status Maven Central

This library delivers a annotation and adds a HandlerMethodArgumentResolver to the Spring MVC framework.

Binaries

Example for Maven:

    <dependency>
      <groupId>de.is24.spring</groupId>
      <artifactId>base64-url-decoder</artifactId>
      <version>1.0</version>
    </dependency>

Usage

Annotate your parameters with the @DecodedUri annotation in a MVC Controller according to this example:

@Controller
public class TestController {
  @RequestMapping("/test")
  public String test(@DecodedUri URI uri) {
    return url.toString();
  }
}

And register the Base64DecodingArgumentResolver in to your MVC context:

@Configuration
public class Web extends WebMvcConfigurerAdapter {
  @Override
  public void addArgumentResolvers(List<HandlerMethodArgumentResolver> argumentResolvers) {
    argumentResolvers.add(new UrlResolvingHandlerMethodArgumentResolver());
  }
}

License

MIT

About

Adds a MVC parameter annotation and a HandlerMethodArgumentResolver to enable decoding Base64 encoded URL parameters.

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages