Win a copy of Svelte and Sapper in Action this week in the JavaScript forum!
  • 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 all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Ron McLeod
  • Paul Clapham
  • Bear Bibeault
  • Junilu Lacar
Sheriffs:
  • Jeanne Boyarsky
  • Tim Cooke
  • Henry Wong
Saloon Keepers:
  • Tim Moores
  • Stephan van Hulst
  • Tim Holloway
  • salvin francis
  • Frits Walraven
Bartenders:
  • Scott Selikoff
  • Piet Souris
  • Carey Brown

jsp page for struts

 
Greenhorn
Posts: 9
  • Mark post as helpful
  • send pies
  • 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
  • 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
  • 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.
 
Roses are red, violets are blue. Some poems rhyme and some don't. And some poems are a tiny ad.
Building a Better World in your Backyard by Paul Wheaton and Shawn Klassen-Koop
https://coderanch.com/wiki/718759/books/Building-World-Backyard-Paul-Wheaton
    Bookmark Topic Watch Topic
  • New Topic