-
Notifications
You must be signed in to change notification settings - Fork 113
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #4707 from soul2zimate/issue4550-alternative-3.0
Issue4550 alternative 3.0
- Loading branch information
Showing
11 changed files
with
367 additions
and
36 deletions.
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
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,36 @@ | ||
<?xml version="1.0" encoding="UTF-8"?> | ||
<!-- | ||
Copyright (c) 1997, 2018 Oracle and/or its affiliates. All rights reserved. | ||
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> | ||
<artifactId>pom</artifactId> | ||
<groupId>com.sun.faces.test.javaee6</groupId> | ||
<version>3.0.0-m01-SNAPSHOT</version> | ||
</parent> | ||
|
||
<artifactId>viewParamNullValueAjax</artifactId> | ||
<packaging>war</packaging> | ||
<name>Mojarra ${project.version} - Test - JavaEE 6 - viewParameter with null value for Ajax</name> | ||
|
||
<build> | ||
<finalName>test-javaee6-viewParamNullValueAjax</finalName> | ||
</build> | ||
|
||
|
||
</project> |
47 changes: 47 additions & 0 deletions
47
...llValueAjax/src/main/java/com/sun/faces/test/javaee6/viewParamNullValueAjax/TestView.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,47 @@ | ||
/* | ||
* Copyright (c) 1997, 2018 Oracle and/or its affiliates. All rights reserved. | ||
* | ||
* 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 | ||
*/ | ||
|
||
package com.sun.faces.test.javaee6.viewParamNullValueAjax; | ||
|
||
import java.io.Serializable; | ||
|
||
import javax.faces.view.ViewScoped; | ||
import javax.inject.Named; | ||
|
||
@ViewScoped | ||
@Named | ||
public class TestView implements Serializable { | ||
|
||
private String testString; | ||
|
||
public void onView() { | ||
testString = "Test Rhuan"; | ||
System.out.println("initializing: " + testString); | ||
} | ||
|
||
public void someMethod() { | ||
System.out.println(testString); | ||
} | ||
|
||
public String getTestString() { | ||
return testString; | ||
} | ||
|
||
public void setTestString(String testString) { | ||
System.out.println("Setting value: " + testString); | ||
this.testString = testString; | ||
} | ||
} |
25 changes: 25 additions & 0 deletions
25
test/javaee6/viewParamNullValueAjax/src/main/webapp/WEB-INF/beans.xml
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,25 @@ | ||
<?xml version="1.0" encoding="UTF-8"?> | ||
<!-- | ||
Copyright (c) 2017, 2018 Oracle and/or its affiliates. All rights reserved. | ||
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 | ||
--> | ||
|
||
<beans xmlns="http://xmlns.jcp.org/xml/ns/javaee" | ||
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" | ||
xsi:schemaLocation="http://xmlns.jcp.org/xml/ns/javaee http://xmlns.jcp.org/xml/ns/javaee/beans_1_1.xsd" | ||
bean-discovery-mode="all" | ||
version="1.1"> | ||
</beans> |
29 changes: 29 additions & 0 deletions
29
test/javaee6/viewParamNullValueAjax/src/main/webapp/WEB-INF/glassfish-web.xml
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,29 @@ | ||
<?xml version="1.0" encoding="UTF-8"?> | ||
<!DOCTYPE glassfish-web-app PUBLIC "-//GlassFish.org//DTD GlassFish Application Server 3.1 Servlet 3.0//EN" "http://glassfish.org/dtds/glassfish-web-app_3_0-1.dtd"> | ||
<!-- | ||
Copyright (c) 2017, 2018 Oracle and/or its affiliates. All rights reserved. | ||
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 | ||
--> | ||
|
||
<glassfish-web-app error-url=""> | ||
<context-root>/test-javaee6-viewParamNullValueAjax</context-root> | ||
<class-loader delegate="true"/> | ||
<jsp-config> | ||
<property name="keepgenerated" value="true"> | ||
<description>Keep a copy of the generated servlet class' java code.</description> | ||
</property> | ||
</jsp-config> | ||
</glassfish-web-app> |
52 changes: 52 additions & 0 deletions
52
test/javaee6/viewParamNullValueAjax/src/main/webapp/WEB-INF/web.xml
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,52 @@ | ||
<?xml version="1.0" encoding="UTF-8"?> | ||
<!-- Copyright (c) 1997, 2018 Oracle and/or its affiliates. All rights reserved. | ||
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="http://xmlns.jcp.org/xml/ns/javaee" | ||
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" | ||
xsi:schemaLocation="http://xmlns.jcp.org/xml/ns/javaee web-app_3_1.xsd" | ||
version="3.1"> | ||
<context-param> | ||
<param-name>javax.faces.INTERPRET_EMPTY_STRING_SUBMITTED_VALUES_AS_NULL</param-name> | ||
<param-value>true</param-value> | ||
</context-param> | ||
<context-param> | ||
<param-name>javax.faces.ENABLE_WEBSOCKET_ENDPOINT</param-name> | ||
<param-value>true</param-value> | ||
</context-param> | ||
<context-param> | ||
<param-name>javax.faces.PROJECT_STAGE</param-name> | ||
<param-value>${webapp.projectStage}</param-value> | ||
</context-param> | ||
<context-param> | ||
<param-name>javax.faces.PARTIAL_STATE_SAVING</param-name> | ||
<param-value>${webapp.partialStateSaving}</param-value> | ||
</context-param> | ||
<context-param> | ||
<param-name>javax.faces.STATE_SAVING_METHOD</param-name> | ||
<param-value>${webapp.stateSavingMethod}</param-value> | ||
</context-param> | ||
<context-param> | ||
<param-name>javax.faces.SERIALIZE_SERVER_STATE</param-name> | ||
<param-value>${webapp.serializeServerState}</param-value> | ||
</context-param> | ||
|
||
<servlet> | ||
<servlet-name>Faces Servlet</servlet-name> | ||
<servlet-class>javax.faces.webapp.FacesServlet</servlet-class> | ||
<load-on-startup>1</load-on-startup> | ||
</servlet> | ||
<servlet-mapping> | ||
<servlet-name>Faces Servlet</servlet-name> | ||
<url-pattern>/faces/*</url-pattern> | ||
</servlet-mapping> | ||
<welcome-file-list> | ||
<welcome-file>faces/viewparam-nullvalue-ajax.xhtml</welcome-file> | ||
</welcome-file-list> | ||
</web-app> |
53 changes: 53 additions & 0 deletions
53
test/javaee6/viewParamNullValueAjax/src/main/webapp/viewparam-nullvalue-ajax.xhtml
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,53 @@ | ||
<?xml version="1.0" encoding="UTF-8"?> | ||
<!-- | ||
Copyright (c) 1997, 2018 Oracle and/or its affiliates. All rights reserved. | ||
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 | ||
--> | ||
|
||
<!DOCTYPE html> | ||
<html xmlns="http://www.w3.org/1999/xhtml" | ||
xmlns:ui="http://java.sun.com/jsf/facelets" | ||
xmlns:f="http://java.sun.com/jsf/core" | ||
xmlns:h="http://java.sun.com/jsf/html"> | ||
<f:metadata> | ||
<f:viewAction action="#{testView.onView}" /> | ||
<f:viewParam name="test" value="#{testView.testString}" /> | ||
</f:metadata> | ||
|
||
<h:head> | ||
<title>issue 4550 viewparameter bug</title> | ||
</h:head> | ||
|
||
<h:body> | ||
<h:form id="form"> | ||
<h:commandButton id="ajaxCommandButton" value="1. ajax request" | ||
action="#{testView.someMethod()}"> | ||
<f:ajax /> | ||
</h:commandButton> | ||
|
||
<br /> | ||
after an ajax request any subsequent call (btn 1 - ajax or btn 2 - non ajax) causes the null value on all view parameters | ||
<br /> | ||
|
||
<h:commandButton id="commandButton" | ||
value="2. second click causes null value" | ||
action="#{testView.someMethod()}" /> | ||
|
||
<h:outputText id="testText" | ||
value="the test text valus is #{testView.testString}" /> | ||
</h:form> | ||
</h:body> | ||
</html> |
Oops, something went wrong.