/    Sign up×
Community /Pin to ProfileBookmark

[RESOLVED] Struts Beginner – Need help debugging an error

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.

[CODE]<&#37;@ 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>[/CODE]

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.

I tried the following three variations of <bean:define and keep coming up with the same error.

[CODE]<bean:define id=”myCalendarBean” name=”calendarBean” />
<bean:define id=”myCalendarBean” name=”calendarBean” />
<bean:define id=”calendarBean” name=”myCalendarBean” />
<bean:define id=”calendarBean” />[/CODE]

So I guess this boils down to two questions.

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?

to post a comment
Java

0Be the first to comment 😎

×

Success!

Help @jeremybwilson spread the word by sharing this article on Twitter...

Tweet This
Sign in
Forgot password?
Sign in with TwitchSign in with GithubCreate Account
about: ({
version: 0.1.9 BETA 6.1,
whats_new: community page,
up_next: more Davinci•003 tasks,
coming_soon: events calendar,
social: @webDeveloperHQ
});

legal: ({
terms: of use,
privacy: policy
});
changelog: (
version: 0.1.9,
notes: added community page

version: 0.1.8,
notes: added Davinci•003

version: 0.1.7,
notes: upvote answers to bounties

version: 0.1.6,
notes: article editor refresh
)...
recent_tips: (
tipper: @meenaratha,
tipped: article
amount: 1000 SATS,

tipper: @meenaratha,
tipped: article
amount: 1000 SATS,

tipper: @AriseFacilitySolutions09,
tipped: article
amount: 1000 SATS,
)...