Hello,

 

Tomcat 10.1.18 with jakarta servlet 6, embedded in our app using jdk17. I
have the following class:

 

public Url(jakarta.servlet.http.HttpServletRequest request){

  System.out.println("this.scheme = '" + request.getScheme() + "'");

  System.out.println("this.protocol = '" + request.getProtocol() + "'");

  System.out.println("this.requestURL = '" + request.getRequestURL() + "'");

}

 

This method prints:

this.scheme = 'HTTP/1.1'

this.protocol = 'HTTP/1.1'

this.requestURL = 'HTTP/1.1://127.0.0.1/derbysoft/multipleavailability'

 

I tried with a couple of jdk17 (openJDK and Zulu) and the result is the
same.

 

Not sure if this a bug or a change in the servlet specification, but it
seems not to be this:

 

https://jakarta.ee/specifications/servlet/6.0/apidocs/jakarta.servlet/jakart
a/servlet/servletrequest#getScheme()

String getScheme()

Returns the name of the scheme used to make this request, for example, http,
https, or ftp. Different schemes have different rules for constructing URLs,
as noted in RFC 1738.

Returns:

a String containing the name of the scheme used to make this request

 

 

Any help would be really appreciated.

 

Thanks,

 

Joan.

Reply via email to