Win a copy of The Java Performance Companion this week in the Performance 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