File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
The moose likes Struts and the fly likes Struts tag - logic:present attribute? Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Frameworks » Struts
Bookmark "Struts tag - logic:present attribute?" Watch "Struts tag - logic:present attribute?" New topic
Author

Struts tag - logic:present attribute?

Jessica Doe
Ranch Hand

Joined: Dec 11, 2003
Posts: 32
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 ]

Jessica Doe<br /> <br />C# Online.NET<br /> <a href="http://wiki.csharp-online.net/" target="_blank" rel="nofollow">http://wiki.csharp-online.net/</a>
Rick Hightower
Author
Ranch Hand

Joined: Feb 20, 2002
Posts: 350
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.


Rick Hightower is CTO of Mammatus which focuses on Cloud Computing, EC2, etc. Rick is invovled in Java CDI and Java EE as well. linkedin,twitter,blog
Jessica Doe
Ranch Hand

Joined: Dec 11, 2003
Posts: 32
Thanks, Rick!
Rick Hightower
Author
Ranch Hand

Joined: Feb 20, 2002
Posts: 350
no problem.
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Struts tag - logic:present attribute?