You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@myfaces.apache.org by mm...@apache.org on 2005/05/17 10:24:13 UTC
svn commit: r170544 - in /myfaces/trunk: build/develop/build.xml
webapps/simple/WEB-INF/web.xml webapps/simple/displayValueOnly.jsp
webapps/src/example/org/apache/myfaces/examples/displayValueOnly/DVOFace.java
Author: mmarinschek
Date: Tue May 17 01:24:11 2005
New Revision: 170544
URL: http://svn.apache.org/viewcvs?rev=170544&view=rev
Log:
displayValueOnly sample page revisited
Modified:
myfaces/trunk/build/develop/build.xml
myfaces/trunk/webapps/simple/WEB-INF/web.xml
myfaces/trunk/webapps/simple/displayValueOnly.jsp
myfaces/trunk/webapps/src/example/org/apache/myfaces/examples/displayValueOnly/DVOFace.java
Modified: myfaces/trunk/build/develop/build.xml
URL: http://svn.apache.org/viewcvs/myfaces/trunk/build/develop/build.xml?rev=170544&r1=170543&r2=170544&view=diff
==============================================================================
--- myfaces/trunk/build/develop/build.xml (original)
+++ myfaces/trunk/build/develop/build.xml Tue May 17 01:24:11 2005
@@ -5,21 +5,33 @@
<!-- Constants -->
<property name="project.dir" location="${basedir}/../.."/>
+
+ <!-- examples webapp-->
<property name="examples.dir" location="${project.dir}/webapps/examples"/>
<property name="examples.src" location="${project.dir}/webapps/src"/>
<property name="examples.web" location="${examples.dir}"/>
<property name="examples.doc" location="${examples.dir}/doc"/>
- <property name="web-inf.classes.dir" location="${examples.web}/WEB-INF/classes"/>
- <property name="web-inf.lib.dir" location="${examples.web}/WEB-INF/lib"/>
+ <property name="examples.web-inf.classes.dir" location="${examples.web}/WEB-INF/classes"/>
+ <property name="examples.web-inf.lib.dir" location="${examples.web}/WEB-INF/lib"/>
+
<property name="myfaces.doc" location="${project.dir}/doc"/>
<property name="share.src" location="${project.dir}/src/share"/>
<property name="myfaces.src" location="${project.dir}/src/myfaces"/>
<property name="components.src" location="${project.dir}/src/components"/>
<property name="jsfapi.src" location="${project.dir}/src/jsfapi"/>
<property name="tlds.dir" location="${project.dir}/tlds"/>
+
<property name="tiles.dir" location="${project.dir}/webapps/tiles"/>
<property name="tiles.web" location="${tiles.dir}/web"/>
+ <!-- simple webapp -->
+ <property name="simple.dir" location="${project.dir}/webapps/simple"/>
+ <property name="simple.src" location="${project.dir}/webapps/src"/>
+ <property name="simple.web" location="${simple.dir}"/>
+ <property name="simple.doc" location="${simple.dir}/doc"/>
+ <property name="simple.web-inf.classes.dir" location="${simple.web}/WEB-INF/classes"/>
+ <property name="simple.web-inf.lib.dir" location="${simple.web}/WEB-INF/lib"/>
+
<!-- Properties -->
<property file="build.local.properties"/>
<property file="build.default.properties"/>
@@ -88,9 +100,9 @@
<target name="prepare-for-debug"
description="copies needed config, TLD files and components-resources">
- <mkdir dir="${web-inf.lib.dir}"/>
+ <mkdir dir="${examples.web-inf.lib.dir}"/>
- <copy todir="${web-inf.lib.dir}">
+ <copy todir="${examples.web-inf.lib.dir}">
<fileset file="${jstl.jar}"/>
<!--fileset file="${jsp-2.0.jar}"/-->
<fileset file="${commons-codec.jar}"/>
@@ -112,17 +124,29 @@
<fileset file="${commons-validator.jar}"/>
<fileset file="${jakarta-oro.jar}"/>
</copy>
+ <copy todir="${simple.web-inf.lib.dir}">
+ <fileset file="${jstl.jar}"/>
+ <fileset file="${jsp-2.0.jar}"/>
+ <fileset file="${commons-codec.jar}"/>
+ <fileset file="${commons-logging.jar}"/>
+ <fileset file="${commons-el.jar}"/>
+ <fileset file="${log4j.jar}"/>
+ <fileset file="${commons-fileupload.jar}"/>
+ <fileset file="${commons-validator.jar}"/>
+ <fileset file="${jakarta-oro.jar}"/>
+ </copy>
<copy file="${project.dir}/conf/develop-web.xml" tofile="${examples.web}/WEB-INF/web.xml" />
<copy file="${project.dir}/conf/tiles/develop-web.xml" tofile="${tiles.web}/WEB-INF/web.xml" />
<copy file="${project.dir}/conf/faces-config.xml" todir="${examples.web}/WEB-INF" />
+ <copy file="${project.dir}/conf/faces-config.xml" todir="${simple.web}/WEB-INF" />
<!-- resolve TLD entities (for containers that do not support entities within TLDs) -->
<xslt basedir="${tlds.dir}"
includes="*.tld"
- destdir="${web-inf.lib.dir}"
+ destdir="${examples.web-inf.lib.dir}"
style="${tlds.dir}/resolve_entities.xsl"
extension=".tld">
<xmlcatalog>
@@ -131,7 +155,10 @@
</xmlcatalog>
</xslt>
<copy todir="${tiles.web}/WEB-INF/lib" >
- <fileset dir="${web-inf.lib.dir}" includes="*.tld" />
+ <fileset dir="${examples.web-inf.lib.dir}" includes="*.tld" />
+ </copy>
+ <copy todir="${simple.web}/WEB-INF/lib" >
+ <fileset dir="${examples.web-inf.lib.dir}" includes="*.tld" />
</copy>
</target>
@@ -142,37 +169,37 @@
depends="prepare-for-debug"
description="compiles the myfaces and examples java classes to WEB-INF/classes and copies needed config and TLD files">
- <mkdir dir="${web-inf.classes.dir}"/>
+ <mkdir dir="${examples.web-inf.classes.dir}"/>
<javac srcdir="${jsfapi.src}"
- destdir="${web-inf.classes.dir}"
+ destdir="${examples.web-inf.classes.dir}"
optimize="off"
debug="on"
classpathref="jsfapi.class.path">
</javac>
<javac srcdir="${share.src}"
- destdir="${web-inf.classes.dir}"
+ destdir="${examples.web-inf.classes.dir}"
optimize="off"
debug="on"
classpathref="share.class.path">
</javac>
<javac srcdir="${myfaces.src}"
- destdir="${web-inf.classes.dir}"
+ destdir="${examples.web-inf.classes.dir}"
optimize="off"
debug="on"
classpathref="myfaces.class.path">
</javac>
<javac srcdir="${components.src}"
- destdir="${web-inf.classes.dir}"
+ destdir="${examples.web-inf.classes.dir}"
optimize="off"
debug="on"
classpathref="components.class.path">
</javac>
- <copy todir="${web-inf.classes.dir}">
+ <copy todir="${examples.web-inf.classes.dir}">
<fileset dir="${myfaces.src}"
includes="**"
excludes="**/*.java
@@ -180,13 +207,13 @@
</copy>
<javac srcdir="${examples.src}"
- destdir="${web-inf.classes.dir}"
+ destdir="${examples.web-inf.classes.dir}"
optimize="off"
debug="on"
classpathref="examples.class.path">
</javac>
- <copy todir="${web-inf.classes.dir}">
+ <copy todir="${examples.web-inf.classes.dir}">
<fileset dir="${examples.src}"
includes="**"
excludes="**/*.java
@@ -198,8 +225,8 @@
<target name="clean"
description="deletes all files that were built">
<delete quiet="true" failonerror="false" includeEmptyDirs="true">
- <fileset dir="${web-inf.classes.dir}"/>
- <fileset dir="${web-inf.lib.dir}"/>
+ <fileset dir="${examples.web-inf.classes.dir}"/>
+ <fileset dir="${examples.web-inf.lib.dir}"/>
<fileset file="${examples.web}/WEB-INF/web.xml"/>
<fileset file="${examples.web}/WEB-INF/faces-config.xml"/>
<fileset file="${examples.web}/jscalendar"/>
Modified: myfaces/trunk/webapps/simple/WEB-INF/web.xml
URL: http://svn.apache.org/viewcvs/myfaces/trunk/webapps/simple/WEB-INF/web.xml?rev=170544&r1=170543&r2=170544&view=diff
==============================================================================
--- myfaces/trunk/webapps/simple/WEB-INF/web.xml (original)
+++ myfaces/trunk/webapps/simple/WEB-INF/web.xml Tue May 17 01:24:11 2005
@@ -22,6 +22,16 @@
<web-app>
+ <!-- This web.xml can be used during debugging, when there is no myfaces.jar
+ library available.
+
+ The faces-config.xml file (that is normally in the myfaces.jar) must be
+ copied to the /WEB-INF directory of the web context.
+
+ The TLDs (that are normally in the myfaces.jar) must be
+ copied to the /WEB-INF/lib directory of the web context.-->
+ <description>debug web.xml</description>
+
<context-param>
<param-name>javax.faces.CONFIG_FILES</param-name>
<param-value>
@@ -36,7 +46,7 @@
<context-param>
<param-name>javax.faces.STATE_SAVING_METHOD</param-name>
- <param-value>server</param-value>
+ <param-value>client</param-value>
<description>
State saving method: "client" or "server" (= default)
See JSF Specification 2.5.2
@@ -56,34 +66,19 @@
Default: "true"
</description>
</context-param>
-
+
<context-param>
<param-name>org.apache.myfaces.DETECT_JAVASCRIPT</param-name>
<param-value>false</param-value>
- <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: "false"
-
- Setting this param to true should be combined with STATE_SAVING_METHOD "server" for
- best results.
-
- This is an EXPERIMENTAL feature. You also have to enable the detector filter/filter mapping below to get
- JavaScript detection working.
- </description>
</context-param>
-
+
<context-param>
<param-name>org.apache.myfaces.PRETTY_HTML</param-name>
<param-value>true</param-value>
<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.
+ influence the HTML code.
Default: "true"
</description>
</context-param>
@@ -95,7 +90,7 @@
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.
+ if you trigger a link or button action that stays on the same page.
Default: "false"
</description>
</context-param>
@@ -118,13 +113,6 @@
</filter>
-->
- <!-- JavaScriptDetector Filter -->
-<!-- <filter>-->
-<!-- <filter-name>javascriptDetector</filter-name>-->
-<!-- <filter-class>org.apache.myfaces.webapp.filter.JavaScriptDetectorFilter</filter-class>-->
-<!-- </filter>-->
-
-
<!-- Extensions Filter -->
<filter>
<filter-name>extensionsFilter</filter-name>
@@ -160,23 +148,6 @@
</init-param>-->
</filter>
-
- <!-- Filter Mappings -->
-
- <!-- see MyFaces Filter above for a description -->
- <!--
- <filter-mapping>
- <filter-name>WelcomeFile Filter</filter-name>
- <url-pattern>/*</url-pattern>
- </filter-mapping>
- -->
-
-<!-- <filter-mapping>-->
-<!-- <filter-name>javascriptDetector</filter-name>-->
-<!-- <url-pattern>/_javascriptDetector_</url-pattern>-->
-<!-- </filter-mapping>-->
-
-
<filter-mapping>
<filter-name>extensionsFilter</filter-name>
<url-pattern>*.jsf</url-pattern>
@@ -201,13 +172,6 @@
<load-on-startup>1</load-on-startup>
</servlet>
- <!-- source code servlet (will not work with JSF virtual path mapping) -->
- <!-- this servlet is optional and for educational purposes only -->
- <servlet>
- <servlet-name>SourceCodeServlet</servlet-name>
- <servlet-class>org.apache.myfaces.examples.servlet.SourceCodeServlet</servlet-class>
- </servlet>
-
<!-- Faces Servlet Mapping -->
@@ -226,17 +190,27 @@
</servlet-mapping>
- <servlet-mapping>
- <servlet-name>SourceCodeServlet</servlet-name>
- <url-pattern>*.source</url-pattern>
- </servlet-mapping>
-
<!-- Welcome files -->
<welcome-file-list>
- <welcome-file>index.jsf</welcome-file>
<welcome-file>index.jsp</welcome-file>
<welcome-file>index.html</welcome-file>
</welcome-file-list>
+
+
+ <taglib>
+ <taglib-uri>http://java.sun.com/jsf/core</taglib-uri>
+ <taglib-location>lib/myfaces_core.tld</taglib-location>
+ </taglib>
+
+ <taglib>
+ <taglib-uri>http://java.sun.com/jsf/html</taglib-uri>
+ <taglib-location>lib/myfaces_html.tld</taglib-location>
+ </taglib>
+
+ <taglib>
+ <taglib-uri>http://myfaces.apache.org/extensions</taglib-uri>
+ <taglib-location>lib/myfaces_ext.tld</taglib-location>
+ </taglib>
</web-app>
Modified: myfaces/trunk/webapps/simple/displayValueOnly.jsp
URL: http://svn.apache.org/viewcvs/myfaces/trunk/webapps/simple/displayValueOnly.jsp?rev=170544&r1=170543&r2=170544&view=diff
==============================================================================
--- myfaces/trunk/webapps/simple/displayValueOnly.jsp (original)
+++ myfaces/trunk/webapps/simple/displayValueOnly.jsp Tue May 17 01:24:11 2005
@@ -28,77 +28,77 @@
<f:view>
- <h1>Usage of the displayValueOnly attribute</h1>
+ <f:verbatim>
+ <h1>Usage of the displayValueOnly attribute</h1>
+ </f:verbatim>
+ <h:form id="form" >
+ <x:saveState id="ss1" value="#{dvoFace.attribute}"/>
+
+ <h:selectBooleanCheckbox
+ id="displayValueOnlyCheckBox"
+ title="displayValueOnly"
+ value="#{dvoFace.attribute}"/>
+ <h:outputLabel id="displayValueOnlyCheckBoxL" for="displayValueOnlyCheckBox" value="displayValueOnly attribute"/>
+
+ <f:verbatim><br/></f:verbatim>
+
+ <h:panelGrid id="firstGrid" columns="2">
+ <h:outputLabel id="inputTextL" for="inputText" value="inputText"/>
+ <x:inputText id="inputText" value="#{dvoFace.map['inputText']}" displayValueOnly="#{dvoFace.attribute}"/>
+
+ <h:outputLabel id="inputTextareaL" for="inputTextarea" value="inputTextarea"/>
+ <x:inputTextarea id="inputTextarea" value="#{dvoFace.map['inputTextarea']}" displayValueOnly="#{dvoFace.attribute}"/>
+
+ <h:outputLabel for="selectManyCheckbox" value="selectManyCheckbox"/>
+ <x:selectManyCheckbox id="selectManyCheckbox" value="#{dvoFace.map['selectManyCheckboxList']}" displayValueOnly="#{dvoFace.attribute}">
+ <f:selectItem itemLabel="Value 1" itemValue="1"/>
+ <f:selectItem itemLabel="Value 2" itemValue="2"/>
+ <f:selectItem itemLabel="Value 3" itemValue="3"/>
+ </x:selectManyCheckbox>
+
+ <%--h:outputLabel for="selectOneMenu" value="selectOneMenu"/>
+ <x:selectOneMenu id="selectOneMenu" value="#{dvoFace.map['selectOneMenu']}" displayValueOnly="#{dvoFace.attribute}">
+ <f:selectItem itemLabel="Value 1" itemValue="1"/>
+ <f:selectItem itemLabel="Value 2" itemValue="2"/>
+ <f:selectItem itemLabel="Value 3" itemValue="3"/>
+ </x:selectOneMenu--%>
+
+ <h:outputLabel id="selectManyMenuL" for="selectManyMenu" value="selectManyMenu"/>
+ <x:selectManyMenu id="selectManyMenu" value="#{dvoFace.map['selectManyMenuList']}" displayValueOnly="#{dvoFace.attribute}">
+ <f:selectItem itemLabel="Value 1" itemValue="1"/>
+ <f:selectItem itemLabel="Value 2" itemValue="2"/>
+ <f:selectItem itemLabel="Value 3" itemValue="3"/>
+ </x:selectManyMenu>
+
+ <%--h:outputLabel for="selectOneListbox" value="selectOneListbox"/>
+ <x:selectOneListbox id="selectOneListbox" value="#{dvoFace.map['selectOneListbox']}" displayValueOnly="#{dvoFace.attribute}">
+ <f:selectItem itemLabel="Value 1" itemValue="1"/>
+ <f:selectItem itemLabel="Value 2" itemValue="2"/>
+ <f:selectItem itemLabel="Value 3" itemValue="3"/>
+ </x:selectOneListbox--%>
+
+ <h:outputLabel id="inputHtmlL" for="inputHtml" value="inputHtml"/>
+ <x:inputHtml id="inputHtml" value="#{dvoFace.map['inputHtml']}" displayValueOnly="#{dvoFace.attribute}"/>
- <h:form>
- <x:saveState value="#{dvoFace.attribute}"/>
-
- <h:selectBooleanCheckbox
- id="displayValueOnlyCheckBox"
- title="displayValueOnly"
- value="#{dvoFace.attribute}"/>
- <h:outputLabel for="displayValueOnlyCheckBox" value="displayValueOnly attribute"/>
-
- <br/>
-
- <h:panelGrid columns="2">
- <h:outputLabel for="inputText" value="inputText"/>
- <x:inputText id="inputText" value="#{dvoFace.map['inputText']}" displayValueOnly="#{dvoFace.attribute}"/>
-
- <h:outputLabel for="inputTextarea" value="inputTextarea"/>
- <x:inputTextarea id="inputTextarea" value="#{dvoFace.map['inputTextarea']}" displayValueOnly="#{dvoFace.attribute}"/>
-
- <h:outputLabel for="selectManyCheckbox" value="selectManyCheckbox"/>
- <x:selectManyCheckbox id="selectManyCheckbox" value="#{dvoFace.map['selectManyCheckboxList']}" displayValueOnly="#{dvoFace.attribute}">
- <f:selectItem itemLabel="Value 1" itemValue="1"/>
- <f:selectItem itemLabel="Value 2" itemValue="2"/>
- <f:selectItem itemLabel="Value 3" itemValue="3"/>
- </x:selectManyCheckbox>
-
- <h:outputLabel for="selectOneMenu" value="selectOneMenu"/>
- <x:selectManyMenu id="selectOneMenu" value="#{dvoFace.map['selectOneMenuList']}" displayValueOnly="#{dvoFace.attribute}">
- <f:selectItem itemLabel="Value 1" itemValue="1"/>
- <f:selectItem itemLabel="Value 2" itemValue="2"/>
- <f:selectItem itemLabel="Value 3" itemValue="3"/>
- </x:selectManyMenu>
-
- <h:outputLabel for="selectManyMenu" value="selectManyMenu"/>
- <x:selectManyMenu id="selectManyMenu" value="#{dvoFace.map['selectManyMenuList']}" displayValueOnly="#{dvoFace.attribute}">
- <f:selectItem itemLabel="Value 1" itemValue="1"/>
- <f:selectItem itemLabel="Value 2" itemValue="2"/>
- <f:selectItem itemLabel="Value 3" itemValue="3"/>
- </x:selectManyMenu>
-
- <%-- h:outputLabel for="selectOneListbox" value="selectOneListbox"/>
- <x:selectOneListbox id="selectOneListbox" value="#{dvoFace.map['selectOneListbox']}" displayValueOnly="#{dvoFace.attribute}">
- <f:selectItem itemLabel="Value 1" itemValue="1"/>
- <f:selectItem itemLabel="Value 2" itemValue="2"/>
- <f:selectItem itemLabel="Value 3" itemValue="3"/>
- </x:selectOneListbox --%>
-
- <h:outputLabel for="inputHtml" value="inputHtml"/>
- <x:inputHtml id="inputHtml" value="#{dvoFace.map['inputHtml']}" displayValueOnly="#{dvoFace.attribute}"/>
-
</h:panelGrid>
- <br/><br/>
-
- <h2>The attribute can also be set for a whole section</h2>
-
- <x:panelGrid columns="2" displayValueOnly="#{dvoFace.attribute}">
- <h:outputLabel for="inputText2" value="inputText"/>
- <x:inputText id="inputText2" value="#{dvoFace.map['inputText2']}"/>
-
- <h:outputLabel for="inputTextarea2" value="inputTextarea"/>
- <x:inputTextarea id="inputTextarea2" value="#{dvoFace.map['inputTextarea2']}"/>
- </x:panelGrid>
-
+ <f:verbatim><br/><br/>
+
+ <h2>The attribute can also be set for a whole section</h2>
- <h:commandButton/>
+ </f:verbatim>
+ <x:panelGrid id="secondGrid" columns="2" displayValueOnly="#{dvoFace.attribute}">
+ <h:outputLabel id="inputText2L" for="inputText2" value="inputText"/>
+ <x:inputText id="inputText2" value="#{dvoFace.map['inputText2']}"/>
+
+ <h:outputLabel id="inputTextArea2L" for="inputTextarea2" value="inputTextarea"/>
+ <x:inputTextarea id="inputTextarea2" value="#{dvoFace.map['inputTextarea2']}"/>
+ </x:panelGrid>
+ <h:commandButton id="submitBtn" />
</h:form>
-</f:view>
+ <%@include file="inc/page_footer.jsp" %>
-<%@include file="inc/page_footer.jsp" %>
+</f:view>
</body>
Modified: myfaces/trunk/webapps/src/example/org/apache/myfaces/examples/displayValueOnly/DVOFace.java
URL: http://svn.apache.org/viewcvs/myfaces/trunk/webapps/src/example/org/apache/myfaces/examples/displayValueOnly/DVOFace.java?rev=170544&r1=170543&r2=170544&view=diff
==============================================================================
--- myfaces/trunk/webapps/src/example/org/apache/myfaces/examples/displayValueOnly/DVOFace.java (original)
+++ myfaces/trunk/webapps/src/example/org/apache/myfaces/examples/displayValueOnly/DVOFace.java Tue May 17 01:24:11 2005
@@ -14,14 +14,14 @@
*/
public class DVOFace implements Serializable
{
- private boolean attribute = false;
+ private boolean attribute = true;
private Map map = new HashMap(){
public Object get(Object key){
Object held = super.get( key );
if( held != null )
return held;
- if( key.toString().toLowerCase().contains("list") )
+ if( key.toString().toLowerCase().indexOf("list")>0 )
return new ArrayList();
return null;