score:-1
@RequestMapping("/spring-web/{symbolicName:[a-z-]+}-{version:\\d\\.\\d\\.\\d}{extension:\\.[a-z]+}")
public void handle(@PathVariable String version, @PathVariable String extension) {
// ...
}
reference https://docs.spring.io/spring/docs/3.2.x/spring-framework-reference/html/mvc.html
https://docs.spring.io/spring/docs/3.0.x/javadoc-api/org/springframework/util/AntPathMatcher.html
score:2
Solution proposed by OP:
@RequestMapping( //
value = {"/**/{extension:(?:\\w|\\W)+\\.(?:jpg|bmp|gif|jpeg|png|webp)$}"}, //
method = RequestMethod.GET //
)
Source: stackoverflow.com
Related Query
- How to match extension in any path level with Spring MVC?
- How can I get Spring MVC to read a path parameter with a date in "2019-3-29" format?
- how to accept any path in Spring boot + MVC
- How to build a Spring MVC based application to connect with any service provider to do the SSO
- In Spring MVC 3, how do I bind an object to a query string when the query string parameters don't match up with the object fields?
- How to respond with HTTP 400 error in a Spring MVC @ResponseBody method returning String?
- How to avoid the "Circular view path" exception with Spring MVC test
- How to log properly http requests with Spring MVC
- How to write a proper global error handler with Spring MVC / Spring Boot
- How can I have case insensitive URLS in Spring MVC with annotated mappings
- How to configure Spring MVC with pure Java-based configuration?
- How to respond with HTTP status code in a Spring MVC @RestController @ResponseBody class returning an object?
- How to create Spring MVC application with Maven structure in Intellij IDEA 13.1?
- How to include js and CSS in JSP with spring MVC
- How to cope with x-forwarded-headers in Spring Boot 2.2.0? (Spring Web MVC behind reverse proxy)
- How do I map Spring MVC controller to a uri with and without trailing slash?
- How to login a user with spring 3.2 new mvc testing
- How to register handler interceptors with spring mvc 3.0?
- How to pass a session attribute as method argument (parameter) with Spring MVC
- How to send a getForObject request with parameters Spring MVC
- How to integrate Apache Spark with Spring MVC web application for interactive user sessions
- How to make Spring MVC controller work with UTF-8?
- How to handle unknown number of parameters with Spring MVC
- How to use Servlet 3 @WebServlet & async with Spring MVC 3?
- How to enable HTTP caching for the resource handler with Spring MVC and Spring Security
- Spring MVC : Redirecting from a base controller - How to get the path to redirect to?
- How to handle 404 page not found exception in Spring MVC with java configuration and no Web.xml
- Spring MVC with Hibernate Validator. How to validate property by group?
- How to use twitter bootstrap with Spring MVC
- How to parse a URL and run a method with Spring MVC 'reflectively'?
More Query from same tag
- How to prevent Spring MVC parameter from being truncated after "."
- Java Spring common way to implement user authentication
- AJAX mechanics when updating view parts
- many commandName for one form in Spring MVC
- Password protecting two web pages with Spring 3.1
- Throwing an exception from @ExceptionHandler to get caught by another handler
- strange error: resource not found on url mapping spring mvc
- why didn't i get the referer parameter in Spring MVC
- Populate dropdown2 based on the selection of dropdown1 in java spring annotation
- How to generate swagger.json
- Spring MVC detect ajax request
- Load multiple Angular projects from Spring boot
- multipart file upload check mime type in java
- Swagger throw UncheckedExecutionException when boot tomcat
- Error to call a rest web service on spring : HTTP Status 406
- SpringMVC + hibernate @ManyToMany, controller losing collection during update
- difference between spring webflow and MVC
- On saving the the data with foreign key relations, it throws exception
- Specific url for controller using @PathVariable in RequestMapping issue
- Error executing TestNG test
- JavaScript submit button to return object response from spring MVC
- Parse JSON record to extract key and value and put into Map in java
- If a Controller has a @Controller annotation, shouldn't that be enough for Spring without component scanning?
- xmlBeanDefinitionStoreException while implementing spring security
- JUnit Mockito SpringMVC 404
- favicon.ico doesn't displayed in spring mvc
- Spring boot with i18n (internationalization) and thymeleaf
- Could not verify the provided CSRF token because your session was not found.</error_description><error>access_denied</error></oauth>*
- Abstract class @RestController Spring 4 - @ResponseBody error
- Is it possible to use asm-x.x.jar in Google App Engine when using Spring Framework?