You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@beehive.apache.org by ek...@apache.org on 2005/05/24 22:33:53 UTC

svn commit: r178276 - in /incubator/beehive/trunk/samples/netui-samples: ./ WEB-INF/src/org/apache/beehive/samples/netui/resources/resourcebinding/ ui/resourcebinding/

Author: ekoneil
Date: Tue May 24 13:33:52 2005
New Revision: 178276

URL: http://svn.apache.org/viewcvs?rev=178276&view=rev
Log:
Add a sample demonstrating NetUI resource bundle data binding.

BB: self
DRT: netui-samples build / test


Added:
    incubator/beehive/trunk/samples/netui-samples/WEB-INF/src/org/apache/beehive/samples/netui/resources/resourcebinding/
    incubator/beehive/trunk/samples/netui-samples/WEB-INF/src/org/apache/beehive/samples/netui/resources/resourcebinding/jspmessages.properties   (with props)
    incubator/beehive/trunk/samples/netui-samples/WEB-INF/src/org/apache/beehive/samples/netui/resources/resourcebinding/messages.properties
    incubator/beehive/trunk/samples/netui-samples/WEB-INF/src/org/apache/beehive/samples/netui/resources/resourcebinding/moremessages.properties
    incubator/beehive/trunk/samples/netui-samples/ui/resourcebinding/
    incubator/beehive/trunk/samples/netui-samples/ui/resourcebinding/Controller.java   (with props)
    incubator/beehive/trunk/samples/netui-samples/ui/resourcebinding/index.jsp   (with props)
Modified:
    incubator/beehive/trunk/samples/netui-samples/index.jsp

Added: incubator/beehive/trunk/samples/netui-samples/WEB-INF/src/org/apache/beehive/samples/netui/resources/resourcebinding/jspmessages.properties
URL: http://svn.apache.org/viewcvs/incubator/beehive/trunk/samples/netui-samples/WEB-INF/src/org/apache/beehive/samples/netui/resources/resourcebinding/jspmessages.properties?rev=178276&view=auto
==============================================================================
--- incubator/beehive/trunk/samples/netui-samples/WEB-INF/src/org/apache/beehive/samples/netui/resources/resourcebinding/jspmessages.properties (added)
+++ incubator/beehive/trunk/samples/netui-samples/WEB-INF/src/org/apache/beehive/samples/netui/resources/resourcebinding/jspmessages.properties Tue May 24 13:33:52 2005
@@ -0,0 +1,3 @@
+# Messages used by the /ui/resourcebinding/Controller.java sample
+
+themessage=This message is a message from a resource bundle called jspmessages.properties
\ No newline at end of file

Propchange: incubator/beehive/trunk/samples/netui-samples/WEB-INF/src/org/apache/beehive/samples/netui/resources/resourcebinding/jspmessages.properties
------------------------------------------------------------------------------
    svn:eol-style = native

Added: incubator/beehive/trunk/samples/netui-samples/WEB-INF/src/org/apache/beehive/samples/netui/resources/resourcebinding/messages.properties
URL: http://svn.apache.org/viewcvs/incubator/beehive/trunk/samples/netui-samples/WEB-INF/src/org/apache/beehive/samples/netui/resources/resourcebinding/messages.properties?rev=178276&view=auto
==============================================================================
--- incubator/beehive/trunk/samples/netui-samples/WEB-INF/src/org/apache/beehive/samples/netui/resources/resourcebinding/messages.properties (added)
+++ incubator/beehive/trunk/samples/netui-samples/WEB-INF/src/org/apache/beehive/samples/netui/resources/resourcebinding/messages.properties Tue May 24 13:33:52 2005
@@ -0,0 +1,3 @@
+# Messages used by ui/resourcebinding/Controller.java
+
+message=This is a message from a resource bundle called messages.properties
\ No newline at end of file

Added: incubator/beehive/trunk/samples/netui-samples/WEB-INF/src/org/apache/beehive/samples/netui/resources/resourcebinding/moremessages.properties
URL: http://svn.apache.org/viewcvs/incubator/beehive/trunk/samples/netui-samples/WEB-INF/src/org/apache/beehive/samples/netui/resources/resourcebinding/moremessages.properties?rev=178276&view=auto
==============================================================================
--- incubator/beehive/trunk/samples/netui-samples/WEB-INF/src/org/apache/beehive/samples/netui/resources/resourcebinding/moremessages.properties (added)
+++ incubator/beehive/trunk/samples/netui-samples/WEB-INF/src/org/apache/beehive/samples/netui/resources/resourcebinding/moremessages.properties Tue May 24 13:33:52 2005
@@ -0,0 +1,3 @@
+# Messages used by ui/resourcebinding/Controller.java
+
+anothermessage=This is a message from a resource bundle called moremessages.properties
\ No newline at end of file

Modified: incubator/beehive/trunk/samples/netui-samples/index.jsp
URL: http://svn.apache.org/viewcvs/incubator/beehive/trunk/samples/netui-samples/index.jsp?rev=178276&r1=178275&r2=178276&view=diff
==============================================================================
--- incubator/beehive/trunk/samples/netui-samples/index.jsp (original)
+++ incubator/beehive/trunk/samples/netui-samples/index.jsp Tue May 24 13:33:52 2005
@@ -62,5 +62,9 @@
       <dt><netui:anchor href="ui/pageinput/Controller.jpf" value="Page Input"/></dt>
       <dd>Demonstrates how to use a Page Flow page inputs to pass data from an action to a JSP page.</dd>
     </dl>
+    <dl>
+      <dt><netui:anchor href="ui/resourcebinding/Controller.jpf" value="Message Resource Binding"/></dt>
+      <dd>Demonstrates how to use JSP EL expressions to data bind to message resources</dd>
+    </dl>
   </netui-template:section>
 </netui-template:template>

Added: incubator/beehive/trunk/samples/netui-samples/ui/resourcebinding/Controller.java
URL: http://svn.apache.org/viewcvs/incubator/beehive/trunk/samples/netui-samples/ui/resourcebinding/Controller.java?rev=178276&view=auto
==============================================================================
--- incubator/beehive/trunk/samples/netui-samples/ui/resourcebinding/Controller.java (added)
+++ incubator/beehive/trunk/samples/netui-samples/ui/resourcebinding/Controller.java Tue May 24 13:33:52 2005
@@ -0,0 +1,37 @@
+/*
+ * Copyright 2004-2005 The Apache Software Foundation.
+ *
+ * Licensed 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.
+ *
+ * $Header:$
+ */
+package ui.resourcebinding;
+
+import org.apache.beehive.netui.pageflow.annotations.Jpf;
+import org.apache.beehive.netui.pageflow.PageFlowController;
+
+/**
+ *
+ */
+@Jpf.Controller(
+    messageBundles={
+        @Jpf.MessageBundle(bundlePath="org.apache.beehive.samples.netui.resources.resourcebinding.messages"),
+        @Jpf.MessageBundle(bundleName="moremessages", bundlePath="org.apache.beehive.samples.netui.resources.resourcebinding.moremessages")
+    },
+    simpleActions={
+        @Jpf.SimpleAction(name="begin",path="index.jsp")
+    }
+)
+public class Controller
+    extends PageFlowController {
+}

Propchange: incubator/beehive/trunk/samples/netui-samples/ui/resourcebinding/Controller.java
------------------------------------------------------------------------------
    svn:eol-style = native

Added: incubator/beehive/trunk/samples/netui-samples/ui/resourcebinding/index.jsp
URL: http://svn.apache.org/viewcvs/incubator/beehive/trunk/samples/netui-samples/ui/resourcebinding/index.jsp?rev=178276&view=auto
==============================================================================
--- incubator/beehive/trunk/samples/netui-samples/ui/resourcebinding/index.jsp (added)
+++ incubator/beehive/trunk/samples/netui-samples/ui/resourcebinding/index.jsp Tue May 24 13:33:52 2005
@@ -0,0 +1,50 @@
+<%--
+   Copyright 2004-2005 The Apache Software Foundation.
+
+   Licensed 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.
+
+   $Header:$
+--%>
+<%@ page language="java" contentType="text/html;charset=UTF-8"%>
+<%@ taglib uri="http://beehive.apache.org/netui/tags-databinding-1.0" prefix="netui-data"%>
+<%@ taglib uri="http://beehive.apache.org/netui/tags-html-1.0" prefix="netui"%>
+<%@ taglib uri="http://beehive.apache.org/netui/tags-template-1.0" prefix="netui-template"%>
+
+<netui-template:template templatePage="/resources/template/template.jsp">
+  <netui-template:setAttribute name="samTitle" value="Resource Bundle Binding"/>
+  <netui-template:section name="main">
+      <b>Binding to the default resource bundle</b>
+      <br/>
+      <table>
+          <tr><td><i>Expression: \${bundle.default.message}</i></td></tr>
+          <tr><td><netui:label value="${bundle.default.message}"/></td></tr>
+      </table>
+      <br/>
+      <b>Binding to a resource bundle named via the @Jpf.Controller annotation</b>
+      <br/>
+      <table>
+          <tr><td><i>Expression: \${bundle.moremessages.anothermessage}</i></td></tr>
+          <tr><td><netui:label value="${bundle.moremessages.anothermessage}"/></td></tr>
+      </table>
+      <br/>
+      <b>Binding to a resource bundle declared with the &lt;netui-data:declareBundle&gt; JSP tag</b>
+      <br/>
+      <netui-data:declareBundle name="pageBundle"
+                                bundlePath="org.apache.beehive.samples.netui.resources.resourcebinding.jspmessages"/>
+      <br/>
+      <table>
+          <tr><td><i>Expression: \${bundle.pageBundle.themessage}</i></td></tr>
+          <tr><td><netui:label value="${bundle.pageBundle.themessage}"/></td></tr>
+      </table>
+  </netui-template:section>
+</netui-template:template>
\ No newline at end of file

Propchange: incubator/beehive/trunk/samples/netui-samples/ui/resourcebinding/index.jsp
------------------------------------------------------------------------------
    svn:eol-style = native