caelum / vraptor4

A web MVC action-based framework, on top of CDI, for fast and maintainable Java development.
http://vraptor.org
Apache License 2.0
349 stars 329 forks source link

Vraptor 4.2.0-RC5 + Java 8 request as POST retrieve null #1138

Closed s3vrlinux closed 5 years ago

s3vrlinux commented 5 years ago

Hello, I'm trying to get a simple parameter from the front end.

wget --user-agent=Mozilla/5.0 --post-data='param1=ridiculous' http://localhost:8080/myapp/test

` @Post("/test") public void test(String param1) {

    this.result.use(json()).withoutRoot()

.from("RESULT: " + param).recursive().serialize(); }` when testing the rest url with wget the return is null.

if I send a json request all works fine, ex: `
@Consumes("application/json") @Post("/test") public void test(String param1) {

    this.result.use(json()).withoutRoot()

.from("RESULT: " + param).recursive().serialize(); }

wget --user-agent=Mozilla/5.0 --header='Content-Type:application/json' --post-data='{param1=ridiculous}' http://localhost:8080/myapp/test ` When sending the same parameter as GET, ex: @Get("/test") all works fine too.

Why does not the Post work? My pom.xml https://github.com/edilinux/vraptor-test/blob/master/pom.xml

Thanks!