eclipse-ee4j / eclipse-ee4j/krazo

Validation doesn't work on OpenLiberty

Open
#293 6 comments 0 reactions 0 assignees View on GitHub
server:liberty
Dominant language
Java
Stars
55
Forks
25
Avg merge
3h 25m
Merged PRs (30d)
3

Description

Trying to build an application with Krazo on Jakarta EE 9, targeted to run on OpenLiberty. I'm using OpenLiberty 22.0.0.4, Krazo 2.0.1 (with the [`LibertyHttpCommunicationUnwrapper`](https://github.com/eclipse-ee4j/krazo/blob/master/resteasy/src/main/java/org/eclipse/krazo/resteasy/core/LibertyHttpCommunicationUnwrapper.java) manually copied in).

The Controller that should process the form is a literal copy of [the example in the MVC 2.0 spec](https://jakarta.ee/specifications/mvc/2.0/jakarta-mvc-spec-2.0.html#data_binding).

I submit the form from the browser, but for convenience, this is the raw request:
```bash
curl 'http://localhost:9080/openliberty-mvc-validation/form/process' -X POST \
-H 'Accept: text/html,application/xhtml+xml,application/xml;q=0.9,image/avif,image/webp,*/*;q=0.8' \
-H 'Accept-Language: en-GB,en;q=0.5' \
-H 'Accept-Encoding: gzip, deflate, br' \
-H 'Content-Type: application/x-www-form-urlencoded' \
--data-raw 'age='
```
When I submit the form, I expect the Controller to be invoked, causing a) a log message to appear and b) **hello.jsp** to be rendered.

Instead, I get an XML response (formatted for reading convenience, the original response is unformatted):

```xml


PROPERTY
age
must be greater than or equal to 18
0

```

The good part is that the validation rules are applied to the input. The bad part is that the Controller is not invoked, and the user is seeing XML in their browser.

Please let me know if there's something I missed in the spec, something else I could try, or some additional information you might need.

Links:
* [Reproducer project](https://github.com/mthmulders/openliberty-mvc-validation). You can start it using `mvn liberty:dev`.

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.