tomcat-taglibs-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Rahul P Akolkar <akol...@us.ibm.com>
Subject Re: Dynamically adding components to pages
Date Tue, 31 May 2005 19:31:12 GMT
"Marius Botha" <marius@workpool.co.za> wrote on 05/31/2005 06:43:33 AM:
<snip/>
> I have a requirement where my system needs to prompt users for certain
> information at certain times in a process. To do this I need to be able 
to
> add components to a page at run time based on a user's permissions. E.g. 
if
> the user is supposed to specify a date for the process to continue, I 
need
> to provide a calendar control; and if the user needs to enter a name, 
then
> provide a textbox. <snip/>

Sounds more like task dependent choices rather than user dependent ones. I 
guess thats an aside.

> I have developed my own custom tags that I would want to
> use but I have the following questions:
> 
> 1. How do I reuse my components in such an environment? I suppose I 
would
> need to provide a StringBuffer or something to my component to write to
> (how?) and then call the doStartTag(), etc. methods manually? <snip/>

Playing container is not a good thing.

> 2. How do I implement this in the JSP, seeing as the html/tags would 
have to
> be inserted at a certain stage. Has anyone done this before or can you 
give
> me any pointers?<snip/>

Can you use JSP 2.0 (if you're not already)? Tag files will give you the 
reuse you're talking about. Write a tag (as a .tag impl) that takes the 
task (or user) name as an attribute, and produces the appropriate controls 
(+ other presentation layer stuff around them). You can (re)use the custom 
tags you wrote in this tag file.

-Rahul

Mime
  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message