source: nutchez-0.1/tomcat/webapps/examples/jsp/jsp2/jspattribute/jspattribute.jsp.html

Last change on this file was 66, checked in by waue, 15 years ago

NutchEz - an easy way to nutch

File size: 2.0 KB
Line 
1<html><body><pre>
2&lt;!--
3 Licensed to the Apache Software Foundation (ASF) under one or more
4  contributor license agreements.  See the NOTICE file distributed with
5  this work for additional information regarding copyright ownership.
6  The ASF licenses this file to You under the Apache License, Version 2.0
7  (the "License"); you may not use this file except in compliance with
8  the License.  You may obtain a copy of the License at
9
10      http://www.apache.org/licenses/LICENSE-2.0
11
12  Unless required by applicable law or agreed to in writing, software
13  distributed under the License is distributed on an "AS IS" BASIS,
14  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
15  See the License for the specific language governing permissions and
16  limitations under the License.
17-->
18&lt;%@ taglib prefix="my" uri="http://jakarta.apache.org/tomcat/jsp2-example-taglib"%>
19
20&lt;html>
21  &lt;head>
22    &lt;title>JSP 2.0 Examples - jsp:attribute and jsp:body&lt;/title>
23  &lt;/head>
24  &lt;body>
25    &lt;h1>JSP 2.0 Examples - jsp:attribute and jsp:body&lt;/h1>
26    &lt;hr>
27    &lt;p>The new &amp;lt;jsp:attribute&amp;gt; and &amp;lt;jsp:body&amp;gt;
28    standard actions can be used to specify the value of any standard
29    action or custom action attribute.&lt;/p>
30    &lt;p>This example uses the &amp;lt;jsp:attribute&amp;gt;
31    standard action to use the output of a custom action invocation
32    (one that simply outputs "Hello, World!") to set the value of a
33    bean property.  This would normally require an intermediary
34    step, such as using JSTL's &amp;lt;c:set&amp;gt; action.&lt;/p>
35    &lt;br>
36    &lt;jsp:useBean id="foo" class="jsp2.examples.FooBean">
37      Bean created!  Setting foo.bar...&lt;br>
38      &lt;jsp:setProperty name="foo" property="bar">
39        &lt;jsp:attribute name="value">
40    &lt;my:helloWorld/>
41        &lt;/jsp:attribute>
42      &lt;/jsp:setProperty>
43    &lt;/jsp:useBean>
44    &lt;br>
45    Result: ${foo.bar}
46  &lt;/body>
47&lt;/html>
48</pre></body></html>
Note: See TracBrowser for help on using the repository browser.