Spring controller - %2F in get parameter
up vote
0
down vote
favorite
Client want to send slash in get parameter
http://localhost/controller/getvalue/hello%2Fworld
so I need to get this "hello%2Fworld" as string parameter. I enabled AllowUrlEncodedSlash and other things, but I always getting exception
Failed to convert value of type 'java.lang.String' to required type 'java.lang.Integer'; nested exception is java.lang.NumberFormatException: For input string: "hello/world"
Why Spring trying to convert this into integer ? And why was %2F automatically converted?
spring-mvc
add a comment |
up vote
0
down vote
favorite
Client want to send slash in get parameter
http://localhost/controller/getvalue/hello%2Fworld
so I need to get this "hello%2Fworld" as string parameter. I enabled AllowUrlEncodedSlash and other things, but I always getting exception
Failed to convert value of type 'java.lang.String' to required type 'java.lang.Integer'; nested exception is java.lang.NumberFormatException: For input string: "hello/world"
Why Spring trying to convert this into integer ? And why was %2F automatically converted?
spring-mvc
1
What is the method signature of the REST endpoint?
– Compass
Nov 19 at 16:17
That's not aGET
parameter but rather the path variable. The rest controller has to be set up in@RequestMapping(value = "/controller/getvalue/{val}"...
way, whereas theval
is expected to be well-formed string
– WildDev
Nov 19 at 16:37
add a comment |
up vote
0
down vote
favorite
up vote
0
down vote
favorite
Client want to send slash in get parameter
http://localhost/controller/getvalue/hello%2Fworld
so I need to get this "hello%2Fworld" as string parameter. I enabled AllowUrlEncodedSlash and other things, but I always getting exception
Failed to convert value of type 'java.lang.String' to required type 'java.lang.Integer'; nested exception is java.lang.NumberFormatException: For input string: "hello/world"
Why Spring trying to convert this into integer ? And why was %2F automatically converted?
spring-mvc
Client want to send slash in get parameter
http://localhost/controller/getvalue/hello%2Fworld
so I need to get this "hello%2Fworld" as string parameter. I enabled AllowUrlEncodedSlash and other things, but I always getting exception
Failed to convert value of type 'java.lang.String' to required type 'java.lang.Integer'; nested exception is java.lang.NumberFormatException: For input string: "hello/world"
Why Spring trying to convert this into integer ? And why was %2F automatically converted?
spring-mvc
spring-mvc
edited Nov 19 at 16:50
Sotirios Delimanolis
205k39465557
205k39465557
asked Nov 19 at 16:08
FoxNet
328
328
1
What is the method signature of the REST endpoint?
– Compass
Nov 19 at 16:17
That's not aGET
parameter but rather the path variable. The rest controller has to be set up in@RequestMapping(value = "/controller/getvalue/{val}"...
way, whereas theval
is expected to be well-formed string
– WildDev
Nov 19 at 16:37
add a comment |
1
What is the method signature of the REST endpoint?
– Compass
Nov 19 at 16:17
That's not aGET
parameter but rather the path variable. The rest controller has to be set up in@RequestMapping(value = "/controller/getvalue/{val}"...
way, whereas theval
is expected to be well-formed string
– WildDev
Nov 19 at 16:37
1
1
What is the method signature of the REST endpoint?
– Compass
Nov 19 at 16:17
What is the method signature of the REST endpoint?
– Compass
Nov 19 at 16:17
That's not a
GET
parameter but rather the path variable. The rest controller has to be set up in @RequestMapping(value = "/controller/getvalue/{val}"...
way, whereas the val
is expected to be well-formed string– WildDev
Nov 19 at 16:37
That's not a
GET
parameter but rather the path variable. The rest controller has to be set up in @RequestMapping(value = "/controller/getvalue/{val}"...
way, whereas the val
is expected to be well-formed string– WildDev
Nov 19 at 16:37
add a comment |
active
oldest
votes
active
oldest
votes
active
oldest
votes
active
oldest
votes
active
oldest
votes
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
StackExchange.ready(
function () {
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f53378579%2fspring-controller-2f-in-get-parameter%23new-answer', 'question_page');
}
);
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
1
What is the method signature of the REST endpoint?
– Compass
Nov 19 at 16:17
That's not a
GET
parameter but rather the path variable. The rest controller has to be set up in@RequestMapping(value = "/controller/getvalue/{val}"...
way, whereas theval
is expected to be well-formed string– WildDev
Nov 19 at 16:37