• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

struts

 
Greenhorn
Posts: 3
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
what is the diffrence between <logic:equals> and <logic:match>
 
Sheriff
Posts: 10445
227
IntelliJ IDE Ubuntu
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
From the API Reference, logic:equal is meant for:

Evaluate the nested body content of this tag if the requested variable is equal to the specified value.



whereas logic:match is meant for:

Evaluate the nested body content of this tag if the specified value is an appropriate substring of the requested variable.

 
Ranch Hand
Posts: 106
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
First thing first, its <logic:equal> not <logic:equals>. You won't want to spend hours debugging over a typo.

Next, check this link out for its API. http://jakarta.apache.org/struts/userGuide/struts-logic.html#equal

You cannot use the tag to compare 2 or more values like you can using scriptlets as you shown in your exam. That means I need to have 2 separate blocks to check that my variable is equal to value 1 or value 2.

Anyway, if you're totally fresh/new to struts, grab a book to read up, or check out its website for tutorials.

Good luck!
 
With a little knowledge, a cast iron skillet is non-stick and lasts a lifetime.
reply
    Bookmark Topic Watch Topic
  • New Topic