<%@ page language="java" %>
<%@ taglib uri="/WEB-INF/struts-html.tld" prefix="html" %>
<%@ taglib uri="/WEB-INF/struts-bean.tld" prefix="bean" %>
<%@ page import="beantaglibs.SomeBean" %>
<html:html>
<head>
<title>Bean Resources sample code</title>
</head>
<body bgcolor="white">

<h3>Bean Resources sample code</h3>

<p>This page provides examples of the following Struts BEAN tags:<br>
<ul>
<li>&lt;bean:message&gt;</li>
<li>&lt;bean:resource&gt;</li>
<li>&lt;bean:struts&gt;</li>
</ul>

<table border="1" width="100%">
  <%--
  The following section contains code getting messages.
  --%>
  <tr>
    <td align="left" colspan="2">
     <% 
        request.setAttribute("stringBean","hello");
        SomeBean bean=new SomeBean();
        bean.setName("hello");
        request.setAttribute("someBean",bean);
     %>
     <bean:message bundle="special" key="hello"/><P>
     <bean:message bundle="special" name="stringBean"/><p>
     <bean:message bundle="special" name="someBean"
                   property="name"/><P>
     <bean:message key="hello" arg0="Linda" />
    </td>
  </tr>
  <%--
  The following section shows how to use web resources.
  --%>
  <tr>
    <td align="left" colspan="2">
testpage1.jsp:<P>
<bean:resource id="resource" name="/testpage1.jsp"/>
<bean:write name="resource"/>
</td>
</tr>
  
  <%--
  The following section shows how to get a Struts configuration object.
  --%>
  <tr>
    <td align="left" colspan="2">
The path of the global forward "BeanResources" is:
<bean:struts id="forward" forward="BeanResources"/>
<bean:write name="forward" property="path"/>
</td>
  </tr>
  <%--
  The following section shows how to get an application web response.
  --%>
  <tr>
    <td align="left">
testPage1:<BR>
<bean:include id="tp1" page="/testpage1.jsp"/>
<bean:write name="tp1" filter="false"/><P>
</td><td align="left">
testPage2:<BR>
<bean:include id="tp2" forward="testpage2"/>
<bean:write name="tp2" filter="false"/><P>
</td>
</tr>
</table>
</body>
</html:html>