Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add support for newer jakarta.servlet.http API into JsonRpcServer #306

Open
cyb3r4nt opened this issue Jan 19, 2023 · 0 comments
Open

Add support for newer jakarta.servlet.http API into JsonRpcServer #306

cyb3r4nt opened this issue Jan 19, 2023 · 0 comments

Comments

@cyb3r4nt
Copy link
Contributor

Newer jakarta.servlet.http API is spreading around and more application servers and frameworks start to support this.
For example, Spring Framework 6 and spring-web started to use that jakarta.* namespace,
and do not provide older javax in transitive dependencies.

Current javax.servlet.http.HttpServletRequest is located at:
https://github.com/briandilley/jsonrpc4j/blob/1.6.0/src/main/java/com/googlecode/jsonrpc4j/JsonRpcServer.java#L107-L157

Newer implementation may look similar and differ only with used request and response types

cyb3r4nt added a commit to cyb3r4nt/jsonrpc4j that referenced this issue Jan 19, 2023
cyb3r4nt added a commit to cyb3r4nt/jsonrpc4j that referenced this issue Jan 19, 2023
…inside JsonRpcServer

Common logic may be used to handle the HTTP requests.
This is a preparation for using jakarta.servlet.http namespace objects.
There are no much requirements for those interfaces,
only some common methods, which are present in most

Portlet API requests were not changed, because there is a comment,
which assumes that HTTP status code is assigned outside.
Added a TODO comment there with possible solution proposal.


Signed-off-by: cyb3r4nt <[email protected]>
cyb3r4nt added a commit to cyb3r4nt/jsonrpc4j that referenced this issue Jan 19, 2023
…into JsonRpcServer

Both javax and jakarta objects/APIs have similar method signatures and differ only with types.
Two new classes were added to adapt to the common interface.

Not very last version of jakarta.servlet-api v5.0.0 was added,
because project JDK target is Java 8.
jakarta.servlet-api v5.0.0 comes from the Jakarta EE 9,
which is still compatible with JDK 8.


Signed-off-by: cyb3r4nt <[email protected]>
cyb3r4nt added a commit to cyb3r4nt/jsonrpc4j that referenced this issue Jan 19, 2023
…onRpcServer

Removed @SuppressWarnings from top-level place on top of the class.
Currently only two handle() methods are shown as unused,
but these are public API methods, which meant to be called by the clients.


Signed-off-by: cyb3r4nt <[email protected]>
briandilley added a commit that referenced this issue May 24, 2023
#306: Add support for newer jakarta.servlet.http API into JsonRpcServer
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant