• 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

jsp page for struts

 
Greenhorn
Posts: 9
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
<logic:present name="lastName" scope="request">
Hello
<logic:equal name="submitForm" property="age" value="a">
young
</logic:equal>
<logic:equal name="submitForm" property="age" value="c">
old
</logic:equal>
<bean:write name="lastName" scope="request"/>
</logic:present>

i was doing some jsp tutorials found online but they produced errors, so when i looked up the answers they were the as the codes above...my question is

why is <logic:equal...> used and what does it mean? whats the difference between <logic:present...> and <logic:equal...> ?

lastly, wat does
<bean:write name="lastName" scope="request"/> do?
 
Ranch Hand
Posts: 220
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi,
As you are aware, the tags you mentioned are all struts tags.
The tag <logic:present ..> is similar to the normal 'if' loop of java.
meaning

if property named lastname exists then enter the loop and do the rest.

similarly <logic:equal ...> ,meaning if the value of the property named 'age' is equal to value 'a' then do this or else do the rest.

and the struts tag <bean:write..> is used to display the output of the
form property value on the screen.


For more clear understanding ,better you go thru the struts HTML,LOGIC,BEAN tags and its libraries.

Cheers
Raj
 
Sheriff
Posts: 13411
Firefox Browser VI Editor Redhat
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
We have a forum devoted to Struts.
This is the best place to ask this question.
Moving this thread to the Struts forum.
 
reply
    Bookmark Topic Watch Topic
  • New Topic