|
Struts example source code file (jsp_1.jsp)
The Struts jsp_1.jsp source code<% request.setAttribute("decorator", "none"); response.setHeader("Cache-Control","no-cache"); //HTTP 1.1 response.setHeader("Pragma","no-cache"); //HTTP 1.0 response.setDateHeader ("Expires", 0); //prevents caching at the proxy server %> <p> <b>Print property value, using the property tag </p> <p> On the OGNL demo you learned how to access values from the Value Stack using OGNL expressions. The <i>property tag is used to print to the page the result of an OGNL expression. The expression is specified in the <i>value attribute. </p> <p>To print the value of the expression name to the page type: <p> <i id="example0"> <s:property value="name" /> </i> </p> <p> on the JSP console and hit enter. <a href="#" onclick="execJSP('example0')">Do it for me </p> <p> As you saw in the OGNL demo, to print a property of an object that is not on top of the stack, use the <i>#object.property notation. </p> <p>To print the value for the key "struts.view_uri" in request to the page type: <p> <i id="example1"> <s:property value="#request['struts.view_uri']" /> </i> </p> <p> on the JSP console and hit enter. <a href="#" onclick="execJSP('example1')">Do it for me </p> <p> <b>Print property value, using the $ operator </p> <p>Use the ${name} notation to print values from the Value Stack to the page. <p>To print the value of the expression name to the page type: <p> <i id="example2"> ${name} </i> </p> <p> on the JSP console and hit enter. <a href="#" onclick="execJSP('example2')">Do it for me </p> <p> <a href="#" onclick="window.open('http://struts.apache.org/2.x/docs/property.html')">[More details] </p> Other Struts examples (source code examples)Here is a short list of links related to this Struts jsp_1.jsp source code file: |
... this post is sponsored by my books ... | |
#1 New Release! |
FP Best Seller |
Copyright 1998-2021 Alvin Alexander, alvinalexander.com
All Rights Reserved.
A percentage of advertising revenue from
pages under the /java/jwarehouse
URI on this website is
paid back to open source projects.