I want to upgrade my project from jetty 9 to 12.
In the previous version, a servlet class was written in our project, whose doGet method signature is as follows
public void doGet(HttpServletRequest req, HttpServletResponse res)
throws ServletException, IOException {
.
.
.
}
In the implementation of doGet method, we have used about 50 nested methods, all of which use the org.eclipse.jetty.server.Request parameter as input. Because that in jetty 9 org.eclipse.jetty.server.Request extends javax..servlet.http.HttpServletRequest, we cast HttpServletRequest class to Request class and therefore we did not have any problems in the code.
but in jetty 12 org.eclipse.jetty.server.Request does not extend HttpServletRequest.
so we have to do one of these two things in the current version of our project:
1- Change the input of all our methods from Request to HttpServletRequest that is not cost-effective for us
2- map HttpServletRequest to Request class.
my questions:
1- How can I map Jakarta.servlet.http.HttpServletRequest to org.eclipse.jetty.server.Request?Is there a library for this?
2- Do you have a better solution?
3-As far as I know, Jetty 12 works with Request and doesn’t have HttpServletRequest anyMore, how does it pass HttpServletRequest to servlets when calling methods of servlet, does it convert itself, or do I have to add something somewhere in the code? I have read this
But Handler can not convert the Request class into HttpServletRequest class, and Even if we change the request, it will be Request class type, not HttpServletRequest class type
@Joakim Erdfelt