Meaningless Drivel is fun!*
The moose likes Servlets and the fly likes Can a custom tag return a jsp tag? Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Android Security Essentials Live Lessons this week in the Android forum!
JavaRanch » Java Forums » Java » Servlets
Bookmark "Can a custom tag return a jsp tag?" Watch "Can a custom tag return a jsp tag?" New topic
Author

Can a custom tag return a jsp tag?

John Pritchard
Ranch Hand

Joined: Nov 15, 2002
Posts: 49
Hi all-
I am fumbling through the correct implementation of the Composite View pattern using custom tags to may runtime determinations of JSP content. I have a custom tag that evaluates the username/password of the user at login and performs a set of :

statements among others. The problem is that all of the html tags that appear in my out.println statements get evaluated fine by the JSP. None of the jsp:includes do however. The statements do end up in the source returned to the browser however. For example if I do a view source on the resulting webpage, I see all the <jsp:include> tags it's just they were not interpretted. I've been through the Professional JSP text but are unable to find a definitive answer if you can return jsp tags in a custom tag. I'm using Weblogic 7.0.
hmmm


John Pritchard<br />If a JTree falls in the woods, is it Observable
Bear Bibeault
Author and ninkuma
Marshal

Joined: Jan 10, 2002
Posts: 60810
    
  65

No, the JSP tags are evaluated at translation time, and your custom tags execute at run time -- long after the JSP tags have been evaluated.
For your particular problem, remember that the value of the page attribute on the jsp include tag can be a run-time value, and you can perform an include operation from within the custom tag code.
hth,
bear
[ January 09, 2003: Message edited by: Bear Bibeault ]

[Asking smart questions] [Bear's FrontMan] [About Bear] [Books by Bear]
 
Consider Paul's rocket mass heater.
 
subject: Can a custom tag return a jsp tag?
 
Similar Threads
Question on TagExtensions
Calling XHTML page in jsp.
[SOLVED] Dynamic <jsp:include> page
Taglib uri..problem..(need help)
using jsp tags in javascript