2

I have a controller which looks like

@RequestMapping(value = "/start/{params}", method = GET, produces = { APPLICATION_JSON_VALUE, APPLICATION_XML_VALUE })
String doStart(@PathVariable("params") Map<String,String> startParams)

How do i send the startParams from the url?

All my tries ends up with:

IllegalStateException: Cannot convert value of type [java.lang.String] to required type [java.util.Map]: no matching editors or conversion strategy found

Also it is not possible to send empty like

theurl/start/

it gives

dec 18, 2015 10:56:07 FM org.springframework.web.servlet.DispatcherServlet noHandlerFound WARNING: No mapping found for HTTP request with URI

Is it somehow possible to send no params, or do i need a separate method for that?:

1

1 Answer 1

1

You have to use @MatrixVariable instead of @PathVariable.

have a look at this example Spring Matrix variable usage

Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.