-
Notifications
You must be signed in to change notification settings - Fork 114
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
Fix Response encoding not stored in the ext context session #5543 #5544
Open
BalusC
wants to merge
5
commits into
4.0
Choose a base branch
from
issue_5543
base: 4.0
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
+258
−46
Open
Changes from all commits
Commits
Show all changes
5 commits
Select commit
Hold shift + click to select a range
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,41 @@ | ||
<?xml version="1.0" encoding="UTF-8"?> | ||
<!-- | ||
|
||
Copyright (c) Contributors to Eclipse Foundation. | ||
|
||
This program and the accompanying materials are made available under the | ||
terms of the Eclipse Public License v. 2.0, which is available at | ||
http://www.eclipse.org/legal/epl-2.0. | ||
|
||
This Source Code may also be made available under the following Secondary | ||
Licenses when the conditions for such availability set forth in the | ||
Eclipse Public License v. 2.0 are satisfied: GNU General Public License, | ||
version 2 with the GNU Classpath Exception, which is available at | ||
https://www.gnu.org/software/classpath/license.html. | ||
|
||
SPDX-License-Identifier: EPL-2.0 OR GPL-2.0 WITH Classpath-exception-2.0 | ||
|
||
--> | ||
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd"> | ||
<modelVersion>4.0.0</modelVersion> | ||
|
||
<parent> | ||
<groupId>org.eclipse.mojarra.test</groupId> | ||
<artifactId>pom</artifactId> | ||
<version>4.0.10-SNAPSHOT</version> | ||
</parent> | ||
|
||
<artifactId>issue5543</artifactId> | ||
<packaging>war</packaging> | ||
|
||
<name>Mojarra ${project.version} - INTEGRATION TESTS - ${project.artifactId}</name> | ||
|
||
<dependencies> | ||
<dependency> | ||
<groupId>org.eclipse.mojarra.test</groupId> | ||
<artifactId>base</artifactId> | ||
<version>${project.version}</version> | ||
<scope>test</scope> | ||
</dependency> | ||
</dependencies> | ||
</project> |
34 changes: 34 additions & 0 deletions
34
test/issue5543/src/main/java/org/eclipse/mojarra/test/issue5543/Issue5543Bean.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,34 @@ | ||
/* | ||
* Copyright (c) Contributors to the Eclipse Foundation. | ||
* | ||
* This program and the accompanying materials are made available under the | ||
* terms of the Eclipse Public License v. 2.0 which is available at | ||
* https://www.eclipse.org/legal/epl-2.0, or the Apache License, Version 2.0 | ||
* which is available at https://www.apache.org/licenses/LICENSE-2.0. | ||
* | ||
* This Source Code may also be made available under the following Secondary | ||
* Licenses when the conditions for such availability set forth in the Eclipse | ||
* Public License v. 2.0 are satisfied: GPL-2.0 with Classpath-exception-2.0 which | ||
* is available at https://openjdk.java.net/legal/gplv2+ce.html. | ||
* | ||
* SPDX-License-Identifier: EPL-2.0 OR GPL-2.0 WITH Classpath-exception-2.0 or Apache-2.0 | ||
*/ | ||
package org.eclipse.mojarra.test.issue5543; | ||
|
||
import jakarta.enterprise.context.RequestScoped; | ||
import jakarta.inject.Named; | ||
|
||
@Named | ||
@RequestScoped | ||
public class Issue5543Bean { | ||
|
||
private String text = "ä"; | ||
|
||
public String getText() { | ||
return text; | ||
} | ||
|
||
public void setText(String text) { | ||
this.text = text; | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,34 @@ | ||
<?xml version="1.0" encoding="UTF-8"?> | ||
<!-- | ||
|
||
Copyright (c) Contributors to Eclipse Foundation. | ||
|
||
This program and the accompanying materials are made available under the | ||
terms of the Eclipse Public License v. 2.0, which is available at | ||
http://www.eclipse.org/legal/epl-2.0. | ||
|
||
This Source Code may also be made available under the following Secondary | ||
Licenses when the conditions for such availability set forth in the | ||
Eclipse Public License v. 2.0 are satisfied: GNU General Public License, | ||
version 2 with the GNU Classpath Exception, which is available at | ||
https://www.gnu.org/software/classpath/license.html. | ||
|
||
SPDX-License-Identifier: EPL-2.0 OR GPL-2.0 WITH Classpath-exception-2.0 | ||
|
||
--> | ||
<web-app | ||
xmlns="https://jakarta.ee/xml/ns/jakartaee" | ||
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" | ||
xsi:schemaLocation="https://jakarta.ee/xml/ns/jakartaee https://jakarta.ee/xml/ns/jakartaee/web-app_5_0.xsd" | ||
version="5.0" | ||
> | ||
<servlet> | ||
<servlet-name>facesServlet</servlet-name> | ||
<servlet-class>jakarta.faces.webapp.FacesServlet</servlet-class> | ||
<load-on-startup>1</load-on-startup> | ||
</servlet> | ||
<servlet-mapping> | ||
<servlet-name>facesServlet</servlet-name> | ||
<url-pattern>*.xhtml</url-pattern> | ||
</servlet-mapping> | ||
</web-app> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,35 @@ | ||
<!DOCTYPE html> | ||
<!-- | ||
|
||
Copyright (c) Contributors to Eclipse Foundation. | ||
|
||
This program and the accompanying materials are made available under the | ||
terms of the Eclipse Public License v. 2.0, which is available at | ||
http://www.eclipse.org/legal/epl-2.0. | ||
|
||
This Source Code may also be made available under the following Secondary | ||
Licenses when the conditions for such availability set forth in the | ||
Eclipse Public License v. 2.0 are satisfied: GNU General Public License, | ||
version 2 with the GNU Classpath Exception, which is available at | ||
https://www.gnu.org/software/classpath/license.html. | ||
|
||
SPDX-License-Identifier: EPL-2.0 OR GPL-2.0 WITH Classpath-exception-2.0 | ||
|
||
--> | ||
<html lang="en" | ||
xmlns:h="jakarta.faces.html" | ||
xmlns:f="jakarta.faces.core" | ||
xmlns:ui="jakarta.faces.facelets" | ||
> | ||
<h:head> | ||
<title>issue5543</title> | ||
</h:head> | ||
<h:body> | ||
<h:form id="form"> | ||
<h:inputText id="input" value="#{issue5543Bean.text}" /> | ||
<h:commandButton id="nonAjaxSubmit" value="non-ajax submit" /> | ||
<h:commandButton id="ajaxSubmit" value="ajax submit"><f:ajax execute="@form" render="@form" /></h:commandButton> | ||
<h:outputText id="output" value="#{issue5543Bean.text}" /> | ||
</h:form> | ||
</h:body> | ||
</html> |
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why is this stored in the session? Please review this with Servlet 6.0 specification, section 5.6. Internationalization in mind.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
As stated in that comment, this is mandated by the JSF 2.3 specification chapter 2.5.2.2 Determining the Character Encoding, see:
"[P1-start-encoding]At the end of the render-response phase, the ViewHandler must store the response character encoding
used by the underlying response object (e.g., the servlet or portlet response) in the session (if and only if a session
already exists) under a well known, implementation-dependent key."
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
As I stated before this needs to be reviewed with the specified Servlet 6.0 specification in mind. I do not object to setting it, but I do not see any logic that looks at the Servlet level. Note that JSF 2.3 is not supported and I assume you meant to refer to Faces specifications?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes, my fault, sorry, I meant Faces 4.0...
Anyhow, the spec has not changed there, see Jakarta Faces 4.0 specification.
As of that I don't see how this is related to the Servlet 6.0 specification, as the Faces specification already requires storing the character encoding in the session.