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/25 01:01:13 UTC
svn commit: r178312 - in /incubator/beehive/trunk/samples/netui-samples:
WEB-INF/tags/ WEB-INF/tags/nameform.tag index.jsp ui/formintagfile/
ui/formintagfile/Controller.java ui/formintagfile/index.jsp
Author: ekoneil
Date: Tue May 24 16:01:12 2005
New Revision: 178312
URL: http://svn.apache.org/viewcvs?rev=178312&view=rev
Log:
Add a netui-samples sample for using a JSP .tag file to contain a NetUI form.
BB: self
DRT: netui-samples builds / runs
Added:
incubator/beehive/trunk/samples/netui-samples/WEB-INF/tags/
incubator/beehive/trunk/samples/netui-samples/WEB-INF/tags/nameform.tag
incubator/beehive/trunk/samples/netui-samples/ui/formintagfile/
incubator/beehive/trunk/samples/netui-samples/ui/formintagfile/Controller.java
incubator/beehive/trunk/samples/netui-samples/ui/formintagfile/index.jsp
Modified:
incubator/beehive/trunk/samples/netui-samples/index.jsp
Added: incubator/beehive/trunk/samples/netui-samples/WEB-INF/tags/nameform.tag
URL: http://svn.apache.org/viewcvs/incubator/beehive/trunk/samples/netui-samples/WEB-INF/tags/nameform.tag?rev=178312&view=auto
==============================================================================
--- incubator/beehive/trunk/samples/netui-samples/WEB-INF/tags/nameform.tag (added)
+++ incubator/beehive/trunk/samples/netui-samples/WEB-INF/tags/nameform.tag Tue May 24 16:01:12 2005
@@ -0,0 +1,15 @@
+<%@ taglib uri="http://beehive.apache.org/netui/tags-html-1.0" prefix="netui"%>
+<%@ taglib uri="http://beehive.apache.org/netui/tags-databinding-1.0" prefix="netui-data"%>
+<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c"%>
+
+<%@ tag body-content="empty" %>
+<%@ attribute name="action" required="true" type="java.lang.String"%>
+
+<div style="border: 3px solid black;padding: 5px;">
+ <netui:form action="${action}">
+ Name: <netui:textBox dataSource="actionForm.name"/>
+ <br/>
+ <br/>
+ <netui:anchor formSubmit="true">Submit</netui:anchor>
+ </netui:form>
+</div>
Modified: incubator/beehive/trunk/samples/netui-samples/index.jsp
URL: http://svn.apache.org/viewcvs/incubator/beehive/trunk/samples/netui-samples/index.jsp?rev=178312&r1=178311&r2=178312&view=diff
==============================================================================
--- incubator/beehive/trunk/samples/netui-samples/index.jsp (original)
+++ incubator/beehive/trunk/samples/netui-samples/index.jsp Tue May 24 16:01:12 2005
@@ -66,5 +66,9 @@
<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>
+ <dl>
+ <dt><netui:anchor href="ui/formintagfile/Controller.jpf" value="JSP Tag File as a Form"/></dt>
+ <dd>Demonstrates how to use a JSP 2.0 .tag file to contain a NetUI form</dd>
+ </dl>
</netui-template:section>
</netui-template:template>
Added: incubator/beehive/trunk/samples/netui-samples/ui/formintagfile/Controller.java
URL: http://svn.apache.org/viewcvs/incubator/beehive/trunk/samples/netui-samples/ui/formintagfile/Controller.java?rev=178312&view=auto
==============================================================================
--- incubator/beehive/trunk/samples/netui-samples/ui/formintagfile/Controller.java (added)
+++ incubator/beehive/trunk/samples/netui-samples/ui/formintagfile/Controller.java Tue May 24 16:01:12 2005
@@ -0,0 +1,57 @@
+/*
+ * 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.formintagfile;
+
+import java.io.Serializable;
+
+import org.apache.beehive.netui.pageflow.annotations.Jpf;
+import org.apache.beehive.netui.pageflow.PageFlowController;
+import org.apache.beehive.netui.pageflow.Forward;
+import org.apache.beehive.netui.pageflow.FormData;
+
+/**
+ */
+@Jpf.Controller(
+ simpleActions={
+ @Jpf.SimpleAction(name="begin", path="index.jsp")
+ }
+)
+public class Controller
+ extends PageFlowController {
+
+ @Jpf.Action(forwards={
+ @Jpf.Forward(name="success", path="index.jsp")
+ })
+ protected Forward update(NameBean form) {
+ return new Forward("success");
+ }
+
+ public static class NameBean
+ implements Serializable {
+
+ private String _name = null;
+
+ public String getName() {
+ return _name;
+ }
+
+ public void setName(String name) {
+ _name = name;
+ }
+ }
+}
\ No newline at end of file
Added: incubator/beehive/trunk/samples/netui-samples/ui/formintagfile/index.jsp
URL: http://svn.apache.org/viewcvs/incubator/beehive/trunk/samples/netui-samples/ui/formintagfile/index.jsp?rev=178312&view=auto
==============================================================================
--- incubator/beehive/trunk/samples/netui-samples/ui/formintagfile/index.jsp (added)
+++ incubator/beehive/trunk/samples/netui-samples/ui/formintagfile/index.jsp Tue May 24 16:01:12 2005
@@ -0,0 +1,38 @@
+<%--
+ 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"%>
+<%@ taglib prefix="tags" tagdir="/WEB-INF/tags" %>
+
+<netui-template:template templatePage="/resources/template/template.jsp">
+ <netui-template:setAttribute name="samTitle" value=""/>
+ <netui-template:section name="main">
+ <br/>
+ <div style="width: 40%">
+ Below, a JSP .tag file is used to render an HTML form. The form's action is passed in
+ from this containing page; the contents of the form are outlined in a black box.
+ </div>
+ <br/>
+ <br/>
+ <tags:nameform action="update"/>
+ <br/>
+ <br/>
+ </netui-template:section>
+</netui-template:template>
\ No newline at end of file