You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@myfaces.apache.org by lu...@apache.org on 2008/06/18 03:38:32 UTC
svn commit: r669045 - in
/myfaces/commons/trunk/myfaces-commons-examples/src/main/webapp: WEB-INF/
WEB-INF/faces-config.xml WEB-INF/web.xml inc/ inc/head.inc
inc/page_footer.jsp index.jsp validate.jsp validateCSV.jsp
validateCompareTo.jsp validateUrl.jsp
Author: lu4242
Date: Tue Jun 17 18:38:31 2008
New Revision: 669045
URL: http://svn.apache.org/viewvc?rev=669045&view=rev
Log:
example
Added:
myfaces/commons/trunk/myfaces-commons-examples/src/main/webapp/WEB-INF/
myfaces/commons/trunk/myfaces-commons-examples/src/main/webapp/WEB-INF/faces-config.xml (with props)
myfaces/commons/trunk/myfaces-commons-examples/src/main/webapp/WEB-INF/web.xml (with props)
myfaces/commons/trunk/myfaces-commons-examples/src/main/webapp/inc/
myfaces/commons/trunk/myfaces-commons-examples/src/main/webapp/inc/head.inc
myfaces/commons/trunk/myfaces-commons-examples/src/main/webapp/inc/page_footer.jsp (with props)
myfaces/commons/trunk/myfaces-commons-examples/src/main/webapp/index.jsp (with props)
myfaces/commons/trunk/myfaces-commons-examples/src/main/webapp/validate.jsp (with props)
myfaces/commons/trunk/myfaces-commons-examples/src/main/webapp/validateCSV.jsp (with props)
myfaces/commons/trunk/myfaces-commons-examples/src/main/webapp/validateCompareTo.jsp (with props)
myfaces/commons/trunk/myfaces-commons-examples/src/main/webapp/validateUrl.jsp (with props)
Added: myfaces/commons/trunk/myfaces-commons-examples/src/main/webapp/WEB-INF/faces-config.xml
URL: http://svn.apache.org/viewvc/myfaces/commons/trunk/myfaces-commons-examples/src/main/webapp/WEB-INF/faces-config.xml?rev=669045&view=auto
==============================================================================
--- myfaces/commons/trunk/myfaces-commons-examples/src/main/webapp/WEB-INF/faces-config.xml (added)
+++ myfaces/commons/trunk/myfaces-commons-examples/src/main/webapp/WEB-INF/faces-config.xml Tue Jun 17 18:38:31 2008
@@ -0,0 +1,20 @@
+<?xml version="1.0"?>
+<faces-config version="1.2" xmlns="http://java.sun.com/xml/ns/javaee"
+ xmlns:xi="http://www.w3.org/2001/XInclude"
+ xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://java.sun.com/xml/ns/javaee http://java.sun.com/xml/ns/javaee/web-facesconfig_1_2.xsd">
+ <managed-bean>
+ <managed-bean-name>dataFieldHolder</managed-bean-name>
+ <managed-bean-class>
+ org.apache.myfaces.commons.examples.DataFieldHolder
+ </managed-bean-class>
+ <managed-bean-scope>request</managed-bean-scope>
+ </managed-bean>
+ <!-- validation -->
+ <managed-bean>
+ <managed-bean-name>validateForm</managed-bean-name>
+ <managed-bean-class>
+ org.apache.myfaces.examples.validate.ValidateForm
+ </managed-bean-class>
+ <managed-bean-scope>request</managed-bean-scope>
+ </managed-bean>
+</faces-config>
Propchange: myfaces/commons/trunk/myfaces-commons-examples/src/main/webapp/WEB-INF/faces-config.xml
------------------------------------------------------------------------------
svn:eol-style = native
Propchange: myfaces/commons/trunk/myfaces-commons-examples/src/main/webapp/WEB-INF/faces-config.xml
------------------------------------------------------------------------------
svn:keywords = Date Author Id Revision HeadURL
Added: myfaces/commons/trunk/myfaces-commons-examples/src/main/webapp/WEB-INF/web.xml
URL: http://svn.apache.org/viewvc/myfaces/commons/trunk/myfaces-commons-examples/src/main/webapp/WEB-INF/web.xml?rev=669045&view=auto
==============================================================================
--- myfaces/commons/trunk/myfaces-commons-examples/src/main/webapp/WEB-INF/web.xml (added)
+++ myfaces/commons/trunk/myfaces-commons-examples/src/main/webapp/WEB-INF/web.xml Tue Jun 17 18:38:31 2008
@@ -0,0 +1,150 @@
+<?xml version="1.0"?>
+
+<!--
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+-->
+<web-app xmlns="http://java.sun.com/xml/ns/j2ee"
+ xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+ xsi:schemaLocation="http://java.sun.com/xml/ns/j2ee http://java.sun.com/xml/ns/j2ee/web-app_2_4.xsd"
+ version="2.4">
+
+ <description>MyProject web.xml</description>
+
+ <!--optional: context-param>
+ <description>Comma separated list of URIs of (additional) faces config files.
+ (e.g. /WEB-INF/my-config.xml)
+ See JSF 1.0 PRD2, 10.3.2
+ Attention: You do not need to put /WEB-INF/faces-config.xml in here.
+ </description>
+ <param-name>javax.faces.CONFIG_FILES</param-name>
+ <param-value>/WEB-INF/examples-config.xml</param-value>
+ </context-param-->
+ <context-param>
+ <description>State saving method: "client" or "server" (= default)
+ See JSF Specification 2.5.3</description>
+ <param-name>javax.faces.STATE_SAVING_METHOD</param-name>
+ <param-value>client</param-value>
+ </context-param>
+ <context-param>
+ <description>Only applicable if state saving method is "server" (= default).
+ Defines the amount (default = 20) of the latest views are stored in session.</description>
+ <param-name>org.apache.myfaces.NUMBER_OF_VIEWS_IN_SESSION</param-name>
+ <param-value>20</param-value>
+ </context-param>
+ <context-param>
+ <description>Only applicable if state saving method is "server" (= default).
+ If true (default) the state will be serialized to a byte stream before it
+ is written to the session.
+ If false the state will not be serialized to a byte stream.</description>
+ <param-name>org.apache.myfaces.SERIALIZE_STATE_IN_SESSION</param-name>
+ <param-value>true</param-value>
+ </context-param>
+ <context-param>
+ <description>Only applicable if state saving method is "server" (= default) and if
+ org.apache.myfaces.SERIALIZE_STATE_IN_SESSION is true (= default)
+ If true (default) the serialized state will be compressed before it
+ is written to the session. If false the state will not be compressed.</description>
+ <param-name>org.apache.myfaces.COMPRESS_STATE_IN_SESSION</param-name>
+ <param-value>true</param-value>
+ </context-param>
+ <context-param>
+ <description>This parameter tells MyFaces if javascript code should be allowed in the
+ rendered HTML output.
+ If javascript is allowed, command_link anchors will have javascript code
+ that submits the corresponding form.
+ If javascript is not allowed, the state saving info and nested parameters
+ will be added as url parameters.
+ Default: "true"</description>
+ <param-name>org.apache.myfaces.ALLOW_JAVASCRIPT</param-name>
+ <param-value>true</param-value>
+ </context-param>
+ <context-param>
+ <param-name>org.apache.myfaces.DETECT_JAVASCRIPT</param-name>
+ <param-value>false</param-value>
+ </context-param>
+ <context-param>
+ <description>If true, rendered HTML code will be formatted, so that it is "human readable".
+ i.e. additional line separators and whitespace will be written, that do not
+ influence the HTML code.
+ Default: "true"</description>
+ <param-name>org.apache.myfaces.PRETTY_HTML</param-name>
+ <param-value>true</param-value>
+ </context-param>
+ <context-param>
+ <description>If true, a javascript function will be rendered that is able to restore the
+ former vertical scroll on every request. Convenient feature if you have pages
+ with long lists and you do not want the browser page to always jump to the top
+ if you trigger a link or button action that stays on the same page.
+ Default: "false"</description>
+ <param-name>org.apache.myfaces.AUTO_SCROLL</param-name>
+ <param-value>true</param-value>
+ </context-param>
+
+ <context-param>
+ <description>Used for encrypting view state. Only relevant for client side
+ state saving. See MyFaces wiki/web site documentation for instructions
+ on how to configure an application for diffenent encryption strengths.
+ </description>
+ <param-name>org.apache.myfaces.SECRET</param-name>
+ <param-value>NzY1NDMyMTA=</param-value>
+ </context-param>
+
+ <context-param>
+ <description>
+ Validate managed beans, navigation rules and ensure that forms are not nested.
+ </description>
+ <param-name>org.apache.myfaces.VALIDATE</param-name>
+ <param-value>true</param-value>
+ </context-param>
+
+ <context-param>
+ <description>
+ Treat readonly same as if disabled attribute was set for select elements.
+ </description>
+ <param-name>org.apache.myfaces.READONLY_AS_DISABLED_FOR_SELECTS</param-name>
+ <param-value>true</param-value>
+ </context-param>
+
+ <context-param>
+ <description>
+ Define partial state saving as true/false.
+ </description>
+ <param-name>javax.faces.PARTIAL_STATE_SAVING_METHOD</param-name>
+ <param-value>false</param-value>
+ </context-param>
+
+ <!-- Faces Servlet -->
+ <servlet>
+ <servlet-name>Faces Servlet</servlet-name>
+ <servlet-class>javax.faces.webapp.FacesServlet</servlet-class>
+ <load-on-startup>1</load-on-startup>
+ </servlet>
+
+ <!-- Faces Servlet Mapping -->
+ <servlet-mapping>
+ <servlet-name>Faces Servlet</servlet-name>
+ <url-pattern>*.jsf</url-pattern>
+ </servlet-mapping>
+
+ <!-- Welcome files -->
+ <welcome-file-list>
+ <welcome-file>index.jsp</welcome-file>
+ <welcome-file>index.html</welcome-file>
+ </welcome-file-list>
+
+</web-app>
Propchange: myfaces/commons/trunk/myfaces-commons-examples/src/main/webapp/WEB-INF/web.xml
------------------------------------------------------------------------------
svn:eol-style = native
Propchange: myfaces/commons/trunk/myfaces-commons-examples/src/main/webapp/WEB-INF/web.xml
------------------------------------------------------------------------------
svn:keywords = Date Author Id Revision HeadURL
Added: myfaces/commons/trunk/myfaces-commons-examples/src/main/webapp/inc/head.inc
URL: http://svn.apache.org/viewvc/myfaces/commons/trunk/myfaces-commons-examples/src/main/webapp/inc/head.inc?rev=669045&view=auto
==============================================================================
--- myfaces/commons/trunk/myfaces-commons-examples/src/main/webapp/inc/head.inc (added)
+++ myfaces/commons/trunk/myfaces-commons-examples/src/main/webapp/inc/head.inc Tue Jun 17 18:38:31 2008
@@ -0,0 +1,5 @@
+<head>
+ <meta HTTP-EQUIV="Content-Type" CONTENT="text/html;charset=UTF-8" />
+ <title>MyFaces - the free JSF Implementation</title>
+ <link rel="stylesheet" type="text/css" href="<%= request.getContextPath() %>/css/basic.css" />
+</head>
Added: myfaces/commons/trunk/myfaces-commons-examples/src/main/webapp/inc/page_footer.jsp
URL: http://svn.apache.org/viewvc/myfaces/commons/trunk/myfaces-commons-examples/src/main/webapp/inc/page_footer.jsp?rev=669045&view=auto
==============================================================================
--- myfaces/commons/trunk/myfaces-commons-examples/src/main/webapp/inc/page_footer.jsp (added)
+++ myfaces/commons/trunk/myfaces-commons-examples/src/main/webapp/inc/page_footer.jsp Tue Jun 17 18:38:31 2008
@@ -0,0 +1,4 @@
+<br/>
+<br/>
+
+<a href="home.jsf">[HOME]</a>
Propchange: myfaces/commons/trunk/myfaces-commons-examples/src/main/webapp/inc/page_footer.jsp
------------------------------------------------------------------------------
svn:eol-style = native
Propchange: myfaces/commons/trunk/myfaces-commons-examples/src/main/webapp/inc/page_footer.jsp
------------------------------------------------------------------------------
svn:keywords = Date Author Id Revision HeadURL
Added: myfaces/commons/trunk/myfaces-commons-examples/src/main/webapp/index.jsp
URL: http://svn.apache.org/viewvc/myfaces/commons/trunk/myfaces-commons-examples/src/main/webapp/index.jsp?rev=669045&view=auto
==============================================================================
--- myfaces/commons/trunk/myfaces-commons-examples/src/main/webapp/index.jsp (added)
+++ myfaces/commons/trunk/myfaces-commons-examples/src/main/webapp/index.jsp Tue Jun 17 18:38:31 2008
@@ -0,0 +1,4 @@
+<%@ page session="false"%>
+<%
+response.sendRedirect("home.jsf");
+%>
\ No newline at end of file
Propchange: myfaces/commons/trunk/myfaces-commons-examples/src/main/webapp/index.jsp
------------------------------------------------------------------------------
svn:eol-style = native
Propchange: myfaces/commons/trunk/myfaces-commons-examples/src/main/webapp/index.jsp
------------------------------------------------------------------------------
svn:keywords = Date Author Id Revision HeadURL
Added: myfaces/commons/trunk/myfaces-commons-examples/src/main/webapp/validate.jsp
URL: http://svn.apache.org/viewvc/myfaces/commons/trunk/myfaces-commons-examples/src/main/webapp/validate.jsp?rev=669045&view=auto
==============================================================================
--- myfaces/commons/trunk/myfaces-commons-examples/src/main/webapp/validate.jsp (added)
+++ myfaces/commons/trunk/myfaces-commons-examples/src/main/webapp/validate.jsp Tue Jun 17 18:38:31 2008
@@ -0,0 +1,91 @@
+<%@ page import="java.math.BigDecimal,
+ java.util.Date" %>
+<%@ page session="false" contentType="text/html;charset=utf-8" %>
+<%@ taglib uri="http://java.sun.com/jsf/html" prefix="h" %>
+<%@ taglib uri="http://java.sun.com/jsf/core" prefix="f" %>
+<%@ taglib uri="http://myfaces.apache.org/commons/converters" prefix="mcc" %>
+<%@ taglib uri="http://myfaces.apache.org/commons/validators" prefix="mcv" %>
+<html>
+
+<%@ include file="inc/head.inc" %>
+
+<!--
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+//-->
+
+<body>
+
+<!--
+managed beans used:
+ validateForm
+-->
+
+<f:view>
+
+ <f:loadBundle basename="org.apache.myfaces.examples.resource.example_messages" var="example_messages"/>
+
+ <h:panelGroup id="body">
+
+ <h:messages showDetail="true" showSummary="false"/>
+
+ <h:form id="form1">
+ <h:panelGrid columns="3">
+
+ <h:outputLabel for="email" value="#{example_messages['validate_email']}"/>
+ <h:inputText id="email" value="#{validateForm.email}" required="true">
+ <f:validator validatorId="org.apache.myfaces.commons.validator.Email"/>
+ </h:inputText>
+ <h:message id="emailError" for="email" styleClass="error"/>
+
+ <h:outputLabel for="email2" value="#{example_messages['validate_email']}2"/>
+ <h:inputText id="email2" value="#{validateForm.email2}" required="true">
+ <mcv:validateEmail detailMessage="Not a valid email address."/>
+ </h:inputText>
+ <h:message id="emailError2" for="email2" styleClass="error"/>
+
+ <h:outputLabel for="creditCardNumber" value="#{example_messages['validate_credit']}"/>
+ <h:inputText id="creditCardNumber" value="#{validateForm.creditCardNumber}" required="true">
+ <mcv:validateCreditCard detailMessage='#{"{0} is not a valid credit card number."}'/>
+ </h:inputText>
+ <h:message id="creditCardNumberError" for="creditCardNumber" styleClass="error"/>
+
+ <h:outputLabel for="regExprValue" value="#{example_messages['validate_regexp']}"/>
+ <h:inputText id="regExprValue" value="#{validateForm.regExpr}" required="true">
+ <mcv:validateRegExpr pattern="[bcr]at" detailMessage='#{"{0} is not valid in this field." }'/>
+ </h:inputText>
+ <h:message id="regExprValueError" for="regExprValue" styleClass="error"/>
+
+ <h:panelGroup/>
+ <h:commandButton id="validateButton" value="#{example_messages['button_submit']}"
+ action="#{validateForm.submit}"/>
+ <h:panelGroup/>
+
+ </h:panelGrid>
+ </h:form>
+
+ </h:panelGroup>
+
+</f:view>
+
+<%@ include file="inc/page_footer.jsp" %>
+
+</body>
+
+</html>
Propchange: myfaces/commons/trunk/myfaces-commons-examples/src/main/webapp/validate.jsp
------------------------------------------------------------------------------
svn:eol-style = native
Propchange: myfaces/commons/trunk/myfaces-commons-examples/src/main/webapp/validate.jsp
------------------------------------------------------------------------------
svn:keywords = Date Author Id Revision HeadURL
Added: myfaces/commons/trunk/myfaces-commons-examples/src/main/webapp/validateCSV.jsp
URL: http://svn.apache.org/viewvc/myfaces/commons/trunk/myfaces-commons-examples/src/main/webapp/validateCSV.jsp?rev=669045&view=auto
==============================================================================
--- myfaces/commons/trunk/myfaces-commons-examples/src/main/webapp/validateCSV.jsp (added)
+++ myfaces/commons/trunk/myfaces-commons-examples/src/main/webapp/validateCSV.jsp Tue Jun 17 18:38:31 2008
@@ -0,0 +1,77 @@
+<%@ page session="false" contentType="text/html;charset=utf-8"%>
+<%@ taglib uri="http://java.sun.com/jsf/html" prefix="h"%>
+<%@ taglib uri="http://java.sun.com/jsf/core" prefix="f"%>
+<%@ taglib uri="http://myfaces.apache.org/commons/converters" prefix="mcc" %>
+<%@ taglib uri="http://myfaces.apache.org/commons/validators" prefix="mcv" %>
+
+<html>
+
+<%@include file="inc/head.inc" %>
+
+<!--
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+//-->
+
+<body>
+
+<!--
+managed beans used:
+ validateForm
+-->
+
+<f:view>
+
+ <f:loadBundle basename="org.apache.myfaces.examples.resource.example_messages" var="example_messages"/>
+
+ <h:panelGroup id="body">
+
+ <h:messages showDetail="true" showSummary="false"/>
+
+ <h:form id="form1">
+ <h:panelGrid columns="3">
+
+ <h:outputLabel for="email" value="#{example_messages['email_comma']}" />
+ <h:inputText id="email" value="#{validateForm.email}" required="true">
+ <mcv:validateCSV subvalidatorId="org.apache.myfaces.commons.validator.Email" />
+ </h:inputText>
+ <h:message id="emailError" for="email" styleClass="error" />
+
+ <h:outputLabel for="creditCardNumber" value="#{example_messages['credit_dot']}" />
+ <h:inputText id="creditCardNumber" value="#{validateForm.creditCardNumber}" required="true">
+ <mcv:validateCSV subvalidatorId="org.apache.myfaces.commons.validator.CreditCard" separator="\\." />
+ </h:inputText>
+ <h:message id="creditCardNumberError" for="creditCardNumber" styleClass="error" />
+
+ <h:panelGroup/>
+ <h:commandButton id="validateButton" value="#{example_messages['button_submit']}" action="#{validateForm.submit}"/>
+ <h:panelGroup/>
+
+ </h:panelGrid>
+ </h:form>
+
+ </h:panelGroup>
+
+</f:view>
+
+<%@include file="inc/page_footer.jsp" %>
+
+</body>
+
+</html>
Propchange: myfaces/commons/trunk/myfaces-commons-examples/src/main/webapp/validateCSV.jsp
------------------------------------------------------------------------------
svn:eol-style = native
Propchange: myfaces/commons/trunk/myfaces-commons-examples/src/main/webapp/validateCSV.jsp
------------------------------------------------------------------------------
svn:keywords = Date Author Id Revision HeadURL
Added: myfaces/commons/trunk/myfaces-commons-examples/src/main/webapp/validateCompareTo.jsp
URL: http://svn.apache.org/viewvc/myfaces/commons/trunk/myfaces-commons-examples/src/main/webapp/validateCompareTo.jsp?rev=669045&view=auto
==============================================================================
--- myfaces/commons/trunk/myfaces-commons-examples/src/main/webapp/validateCompareTo.jsp (added)
+++ myfaces/commons/trunk/myfaces-commons-examples/src/main/webapp/validateCompareTo.jsp Tue Jun 17 18:38:31 2008
@@ -0,0 +1,105 @@
+<%@ page session="false" contentType="text/html;charset=utf-8"%>
+<%@ taglib uri="http://java.sun.com/jsf/html" prefix="h"%>
+<%@ taglib uri="http://java.sun.com/jsf/core" prefix="f"%>
+<%@ taglib uri="http://myfaces.apache.org/commons/converters" prefix="mcc" %>
+<%@ taglib uri="http://myfaces.apache.org/commons/validators" prefix="mcv" %>
+
+<html>
+
+<%@include file="inc/head.inc" %>
+
+<!--
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+//-->
+
+<body>
+
+<!--
+managed beans used:
+ validateForm
+-->
+
+<f:view>
+
+ <f:loadBundle basename="org.apache.myfaces.examples.resource.example_messages" var="example_messages"/>
+
+ <h:panelGroup id="body">
+
+ <h:form id="form1">
+ <h:messages showDetail="true" showSummary="false"/>
+
+ <h:panelGrid columns="3">
+
+ <h:outputLabel for="baseInput" value="#{example_messages['validate_base']}" />
+ <h:inputText id="baseInput" value="#{validateForm.equal}" required="true"/>
+ <h:message id="baseError" for="baseInput" styleClass="error" />
+
+ <h:outputLabel for="eqInput" value="#{example_messages['validate_equal']}" />
+ <h:inputText id="eqInput" required="true">
+ <mcv:validateCompareTo for="baseInput" operator="eq" />
+ </h:inputText>
+ <h:message id="eqError" for="eqInput" styleClass="error" />
+
+ <h:outputLabel for="neInput" value="#{example_messages['validate_notequal']}" />
+ <h:inputText id="neInput" required="true">
+ <mcv:validateCompareTo for="baseInput" operator="ne" />
+ </h:inputText>
+ <h:message id="neError" for="neInput" styleClass="error" />
+
+ <h:outputLabel for="gtInput" value="#{example_messages['validate_greaterthan']}" />
+ <h:inputText id="gtInput" required="true">
+ <mcv:validateCompareTo for="baseInput" operator="gt" />
+ </h:inputText>
+ <h:message id="gtError" for="gtInput" styleClass="error" />
+
+ <h:outputLabel for="geInput" value="#{example_messages['validate_greaterthanequal']}" />
+ <h:inputText id="geInput" required="true">
+ <mcv:validateCompareTo for="baseInput" operator="ge" />
+ </h:inputText>
+ <h:message id="geError" for="geInput" styleClass="error" />
+
+ <h:outputLabel for="ltInput" value="#{example_messages['validate_lessthan']}" />
+ <h:inputText id="ltInput" required="true">
+ <mcv:validateCompareTo for="baseInput" operator="lt" />
+ </h:inputText>
+ <h:message id="ltError" for="ltInput" styleClass="error" />
+
+ <h:outputLabel for="leInput" value="#{example_messages['validate_lessthanequal']}" />
+ <h:inputText id="leInput" required="true">
+ <mcv:validateCompareTo for="baseInput" operator="le" />
+ </h:inputText>
+ <h:message id="leError" for="leInput" styleClass="error" />
+
+ <h:panelGroup/>
+ <h:commandButton id="validateButton" value="#{example_messages['button_submit']}" action="#{validateForm.submit}"/>
+ <h:panelGroup/>
+
+ </h:panelGrid>
+ </h:form>
+
+ </h:panelGroup>
+
+</f:view>
+
+<%@include file="inc/page_footer.jsp" %>
+
+</body>
+
+</html>
Propchange: myfaces/commons/trunk/myfaces-commons-examples/src/main/webapp/validateCompareTo.jsp
------------------------------------------------------------------------------
svn:eol-style = native
Propchange: myfaces/commons/trunk/myfaces-commons-examples/src/main/webapp/validateCompareTo.jsp
------------------------------------------------------------------------------
svn:keywords = Date Author Id Revision HeadURL
Added: myfaces/commons/trunk/myfaces-commons-examples/src/main/webapp/validateUrl.jsp
URL: http://svn.apache.org/viewvc/myfaces/commons/trunk/myfaces-commons-examples/src/main/webapp/validateUrl.jsp?rev=669045&view=auto
==============================================================================
--- myfaces/commons/trunk/myfaces-commons-examples/src/main/webapp/validateUrl.jsp (added)
+++ myfaces/commons/trunk/myfaces-commons-examples/src/main/webapp/validateUrl.jsp Tue Jun 17 18:38:31 2008
@@ -0,0 +1,69 @@
+<%@ page session="false" contentType="text/html;charset=utf-8"%>
+<%@ taglib uri="http://java.sun.com/jsf/html" prefix="h"%>
+<%@ taglib uri="http://java.sun.com/jsf/core" prefix="f"%>
+<%@ taglib uri="http://myfaces.apache.org/commons/converters" prefix="mcc" %>
+<%@ taglib uri="http://myfaces.apache.org/commons/validators" prefix="mcv" %>
+
+<html>
+
+<%@include file="inc/head.inc" %>
+
+<!--
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+//-->
+
+<body>
+
+<!--
+managed beans used:
+ validateForm
+-->
+
+<f:view>
+
+ <f:loadBundle basename="org.apache.myfaces.examples.resource.example_messages" var="example_messages"/>
+
+ <h:panelGroup id="body">
+
+ <h:form id="form1">
+ <h:panelGrid columns="3">
+
+ <h:outputLabel for="url" value="#{example_messages['validate_url']}" />
+ <h:inputText id="url" value="#{validateForm.url}" required="true">
+ <mcv:validateUrl schemes="http,https" allow2Slashes="true"/>
+ </h:inputText>
+ <h:message id="urlError" for="url" styleClass="error" />
+
+ <h:panelGroup/>
+ <h:commandButton id="validateButton" value="#{example_messages['button_submit']}" action="#{validateForm.submit}"/>
+ <h:panelGroup/>
+
+ </h:panelGrid>
+ </h:form>
+
+ </h:panelGroup>
+
+</f:view>
+
+<%@include file="inc/page_footer.jsp" %>
+
+</body>
+
+</html>
Propchange: myfaces/commons/trunk/myfaces-commons-examples/src/main/webapp/validateUrl.jsp
------------------------------------------------------------------------------
svn:eol-style = native
Propchange: myfaces/commons/trunk/myfaces-commons-examples/src/main/webapp/validateUrl.jsp
------------------------------------------------------------------------------
svn:keywords = Date Author Id Revision HeadURL