This week's book giveaway is in the OCAJP forum.
We're giving away four copies of Programmer's Guide to Java SE 8 Oracle Certified Associate (OCA) and have Khalid A Mughal & Rolf W Rasmussen on-line!
See this thread for details.
Win a copy of Programmer's Guide to Java SE 8 Oracle Certified Associate (OCA) this week in the OCAJP forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Struts tag - logic:present attribute?

 
Jessica Doe
Ranch Hand
Posts: 32
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi,
I am trying to test for the presence of a request attribute called "PCAT".
This works:
if (request.getAttribute ("PCAT") != null)
This doesn't work:
<logic:present parameter="PCAT">
</logic:present>
What Struts logic tag would work?
Thanks,
Jessie
[ December 27, 2003: Message edited by: Jessica Doe ]
 
Rick Hightower
Author
Ranch Hand
Posts: 350
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
You want:

The above checks to see if the request attribute PCAT is present.
If you leave off the scope, and just use the name it will search from page scope to aplication scope (inner most to outer most scope).
What you wrote:

Would check to see if a request parameter called PCAT was present.
 
Jessica Doe
Ranch Hand
Posts: 32
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thanks, Rick!
 
Rick Hightower
Author
Ranch Hand
Posts: 350
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
no problem.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic