I am going through what are for the most part simple Struts examples and tutorials on my company's Intranet.
I am however running into an error with the following block of code and I am hoping for help in determining where I have gone astray.
I'm getting at error at line 11, just before the first <logic:if> tag and I presume it is because a bean must be properly defined.Code:<%@ page contentType="text/html; charset=UTF-8" %> <%@ taglib uri="/tlds/marketmaker.tld" prefix="dr" %> <%@ taglib uri="/tlds/struts-bean.tld" prefix="bean" %> <%@ taglib uri="/tlds/struts-logic.tld" prefix="logic" %> <%@ taglib uri="/tlds/struts-html.tld" prefix="html" %> <%@ taglib uri="/tlds/jdo.tld" prefix="jdo" %> <%@ taglib uri="/tlds/string.tld" prefix="str" %> <abc:page> <h3>logic:if</h3> <logic:if name="calendarBean" property="month" op="equal" value="June"> <logic:or name="calendarBean" property="year" op="lessEqual" value="2012"/> <!-- Note self-closing --> <logic:or name="calendarBean" property="day" op="equal" value="Friday"/> <logic:then> <p>At least one condition above is true.</p> </logic:then> <logic:else> <p>None of the conditions are true.</p> </logic:else> </logic:if> </abc:page>
I tried the following three variations of <bean:define and keep coming up with the same error.
So I guess this boils down to two questions.Code:<bean:define id="myCalendarBean" name="calendarBean" /> <bean:define id="myCalendarBean" name="calendarBean" /> <bean:define id="calendarBean" name="myCalendarBean" /> <bean:define id="calendarBean" />
1) Am I right about defining a bean first and 2) what am I doing incorrectly in the previous four <bean:define> declarations listed above?


Reply With Quote
Bookmarks