-
Notifications
You must be signed in to change notification settings - Fork 55
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 ExternalContext.setResponseContentLengthLong #1764
Comments
@arjantijms @BalusC can we do this for 4.0? small and good API enhancement |
I'm wondering if we can't just update setResponseContentLength to take long instead of int.
FYI: work around: |
@tandraschko maybe it could be used in PF as well 😉 |
@BalusC yeah, i think we can just switch int to long |
Looks non-standard seeing how all the other additions of Long were handled (for example in ServletResponse). Something may not compile somewhere. |
Java 1.5 introduced autoboxing. That servlet method might have been added with earlier Java version in mind. I can't think of Java 1.5+ cases where it would fail. Just did a quick test for sake that:
|
Ok nevermind. It will indeed fail when one extends |
Compiler is neither. Autoboxing is one thing. But you can have different type mismatches here (primitive int to object Long and class mismatch). |
So assuming setValue and getValue used to be Integer and now will change to Long it will break code for many. Not that it's hard to fix, but still. Override is also a valid point. |
Ah my mistake, I was coming from PF Integer/Long methods, ExternalContext and ServletResponse use primitives. That helps a lot. |
Moreover there's no getResponseContentLength(). |
Still, assymetry in APIs hurts my eyes :) |
Specify ExternalContext#setResponseContentLengthLong
Implement ExternalContext#setResponseContentLengthLong
Add ExternalContextWrapper#setResponseContentLengthLong
I have discovered that ExternalContext.setResponseContentLength is supposed to call ServletResponse.setContentLength.
Currently ServletResponse provides long variant as well for files bigger than 2GB - ServletResponse.setContentLengthLong (since version 3.1). Sadly there is no corresponding method for ExternalContext and thus it's harder to serve bigger files using ExternalContext. Please add the mising method to API.
The text was updated successfully, but these errors were encountered: