aspose file tools*
The moose likes Struts and the fly likes How to intercept JSTL and Struts Tag Behavior Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Soft Skills this week in the Jobs Discussion forum!
JavaRanch » Java Forums » Frameworks » Struts
Bookmark "How to intercept JSTL and Struts Tag Behavior" Watch "How to intercept JSTL and Struts Tag Behavior" New topic
Author

How to intercept JSTL and Struts Tag Behavior

William Nielsen
Greenhorn

Joined: Dec 22, 2009
Posts: 2
I am faced with an interested design issue. In a JSP page, I need to write out a special text string along with the "name" attribute for JSTL and Struts logic tags (e.g., c:if, c:when, etc...) for all start and end tags.
So, for example:

Should render the following when displayed:


How would I override/intercept the JSTL and Struts tag logic in order to inject/override the (I assume) doStartTag / doEndTag logic? I've been googling and thinking about this for days to no avail. Please help!
David Newton
Author
Rancher

Joined: Sep 29, 2008
Posts: 12617

You don't. You'd need to write a custom tag to do that. This is trivial in JSP 2.0+.

Why would you need to do this?
William Nielsen
Greenhorn

Joined: Dec 22, 2009
Posts: 2
David Newton wrote:You don't. You'd need to write a custom tag to do that. This is trivial in JSP 2.0+.

Why would you need to do this?


I am integrating a search engine with an app that uses custom tags as well as JSTL and Struts tags for presentation logic. What I need is the search engine index task to "see" what the expression name is for all tags so I can have the search engine "remember" who should see a text blurb or not. In other words I don't want the index task to index "Text A" for someone who isn't supposed to see "Text A". My plan was to have a index 'super user' ID that evaluated to "true" for the custom tags but write out a comment or reserved text before and after the tags so the index engine remembers what security tag governs that block.
Bear Bibeault
Author and ninkuma
Marshal

Joined: Jan 10, 2002
Posts: 61761
    
  67

Please be sure to ask Struts questions in the Struts forum. I have moved this post there for you.


[Asking smart questions] [Bear's FrontMan] [About Bear] [Books by Bear]
David Newton
Author
Rancher

Joined: Sep 29, 2008
Posts: 12617

I guess I still really don't understand. It sure seems like this is something that should be done on the server side, though.
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: How to intercept JSTL and Struts Tag Behavior