Skip to content

Commit

Permalink
Correct bean validation applicationi for challange 1715
Browse files Browse the repository at this point in the history
  • Loading branch information
volosied committed Dec 13, 2022
1 parent 0230b6d commit 3431822
Show file tree
Hide file tree
Showing 4 changed files with 37 additions and 6 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@

import java.io.Serializable;

@UserPassword
@UserPassword(groups = {UserPasswordValidatorGroup.class})
public class User implements Serializable {

private static final long serialVersionUID = 1L;
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
/*
* 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 ee.jakarta.tck.faces.test.javaee8.validateWholeBean;

public interface UserPasswordValidatorGroup {

}
8 changes: 6 additions & 2 deletions tck/faces23/validateWholeBean/src/main/webapp/Issue4083.xhtml
Original file line number Diff line number Diff line change
Expand Up @@ -33,10 +33,14 @@
<h:panelGrid columns="2">

<h:outputText value="Password" />
<h:inputSecret id="password1" value="#{backingBean.password1}"/>
<h:inputSecret id="password1" value="#{backingBean.password1}">
<f:validateBean validationGroups="ee.jakarta.tck.faces.test.javaee8.validateWholeBean.UserPasswordValidatorGroup" />
</h:inputSecret>

<h:outputText value="Password again" />
<h:inputSecret id="password2" value="#{backingBean.password2}"/>
<h:inputSecret id="password2" value="#{backingBean.password2}">
<f:validateBean validationGroups="ee.jakarta.tck.faces.test.javaee8.validateWholeBean.UserPasswordValidatorGroup" />
</h:inputSecret>

<h:commandButton id="submit" value="Submit"/>
</h:panelGrid>
Expand Down
12 changes: 9 additions & 3 deletions tck/faces23/validateWholeBean/src/main/webapp/Issue4313.xhtml
Original file line number Diff line number Diff line change
Expand Up @@ -30,17 +30,23 @@
<h:panelGrid columns="2">

<h:outputText value="Password" />
<h:inputSecret id="password1" value="#{backingBean.user.password1}"/>
<h:inputSecret id="password1" value="#{backingBean.user.password1}">
<f:validateBean validationGroups="ee.jakarta.tck.faces.test.javaee8.validateWholeBean.UserPasswordValidatorGroup" />
</h:inputSecret>

<h:outputText value="Password again" />
<h:inputSecret id="password2" value="#{backingBean.user.password2}"/>
<h:inputSecret id="password2" value="#{backingBean.user.password2}">
<f:validateBean validationGroups="ee.jakarta.tck.faces.test.javaee8.validateWholeBean.UserPasswordValidatorGroup" />
</h:inputSecret>

<h:commandButton id="submit" value="Submit"/>
</h:panelGrid>

<h:messages id="err"/>

<f:validateWholeBean value="#{backingBean.user}" />
<f:validateWholeBean
value="#{backingBean.user}"
validationGroups="ee.jakarta.tck.faces.test.javaee8.validateWholeBean.UserPasswordValidatorGroup" />
</h:form>
</h:body>
</html>

0 comments on commit 3431822

Please sign in to comment.