This week's giveaway is in the Android forum.
We're giving away four copies of Android Security Essentials Live Lessons and have Godfrey Nolan on-line!
See this thread for details.
The moose likes Struts and the fly likes Help needed for Struts' logic:equal Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Android Security Essentials Live Lessons this week in the Android forum!
JavaRanch » Java Forums » Frameworks » Struts
Bookmark "Help needed for Struts Watch "Help needed for Struts New topic
Author

Help needed for Struts' logic:equal

Jane Somerfield
Ranch Hand

Joined: Jul 20, 2002
Posts: 193
Does anyone know how to use Struts' <logic:equal> tag or a link for the examples of using it?
I'm doing something like following:
<jsp:useBean id="myForm" scope="session" class="com.MyForm" />
...

<logic:equal name="myForm" property="myProperty" value="myValue" >
<bean:message key="label.myLabel" />:
</logic:equal >
myForm is an instance of MyForm bean, and myProperty is one of its properties.
When myProperty equals to myValue, the message pointed by label.myLabel in the
message resource should be printed.
When I ran the above code I got following error: No-matching extension tags
Could someone help me? Thanks.
Adam Hardy
Ranch Hand

Joined: Oct 09, 2001
Posts: 565
Hi,
I don't recognise the error, and your logic tag seems to be OK. It looks like the error is coming from something else.
It seems strange that you are instantiating your form bean in your jsp with the useBean tag. Why don't you declare the form bean in struts-config.xml?
Otherwise, how are you sure that this error comes from the logic tag? Post the first couple of lines of the stack trace, or at least the classes that are causing the crash.


I have seen things you people would not believe, attack ships on fire off the shoulder of Orion, c-beams sparkling in the dark near the Tennhauser Gate. All these moments will be lost in time, like tears in the rain.
Chuck Lowry
Greenhorn

Joined: May 29, 2002
Posts: 13
I've seen that message a couple of times and pulled my hair out trying to figure out what was wrong with my tags, when it actually was a problem from above the stated non-matched tag. In my case, it has usually been a missed quotation mark. Eg:
<html:text property="text1 /> <--Missed quote here
<html:select property="select1" />
<html ption value="1">1</html ption>
</html:select>
This may give an error like: "Non-matching tags: '</html:select>'", when the problem is actually that I missed a quote above, it ruined my opening html:select tag, and now my end tag is lonely. Also look for missed >.
 
It is sorta covered in the JavaRanch Style Guide.
 
subject: Help needed for Struts' logic:equal
 
Similar Threads
html:text + struts + disable/readOnly problem
session variable in presentation layer
Passing Arraylist from JSP to action class
if statement with stuts:logic
Java Beans