Re: Acessing TagHandlerPool for TagSupport

2006-02-20 Thread Steve Vanspall

Thanks will have a look,

yeah I figured reevaluation isn't the go.

as I said I know the action I want is already going to be configure din 
the struts-config file, so basically I need to look it up, then create a 
form for it.


I can fudge it by codig the HTML roughly as teh struts tage would do it, 
if only I could look up struts-config from a TagSupport extension.




Craig McClanahan wrote:


On 2/19/06, Steve Vanspall [EMAIL PROTECTED] wrote:
 


I know this isn't specifically struts realted, but am having trouble
finding a jasper mailing list.

Basically was wondering if I can have a custom tagsupport tag's
doStartTag() method acess the taghandlerpool.
   




There is no API for this.  Indeed, in JSP 2.0 if you use simple tags there
is no pooling of tag instances either.

Basically i want ot be able to create a form, where neccesary, with a
 


start tag.

but, like struts does, only know the action and parameters adn be able
to look up what form I should be using.

Also it would help if I knew how many form were laready in use, and if a
form tag was open, and hence can throw an error.

So basically, I could create a html:form within some code that this tag
creates.

Alternatively, although not the most desirable option, is the a way to
output html:form as part fo the start tag, and get the JSP to re
evaluated it again.

Theres' probably a simple, duh!, solution coming my way, just can't seem
to find the answer.
   




What you need to build forms like this dynamically is a component model like
the one provided by JavaServer Faces or Tapestry.  The Shale framework[1]
(also part of the Struts community), built on top of JSF, has an example of
building views dynamically that is somewhat different than your use case (it
lets you do SQL Browser queries, and dynamically decides what columns to
show in the output table based on which database columns were returned in
response to executing the query), but illustrates the principle.  It would
be straightforward, for example, to dynamically generate a set of field
labels and input fields based on the columns in a database, or the
properties of a JavaBean.

Trying to dynamically construct JSP code and then re-evaluate it is not
the right approach to this kind of problem.

Thanks
 


Steve
   




Craig

[1] http://struts.apache.org/struts-shale/


-
 


To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]


   



 






-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Re: Acessing TagHandlerPool for TagSupport

2006-02-20 Thread Steve Vanspall

ok thanks,

that will solve my problem

Steve

Craig McClanahan wrote:


On 2/20/06, Steve Vanspall [EMAIL PROTECTED] wrote:
 


Thanks will have a look,

yeah I figured reevaluation isn't the go.

as I said I know the action I want is already going to be configure din
the struts-config file, so basically I need to look it up, then create a
form for it.

I can fudge it by codig the HTML roughly as teh struts tage would do it,
if only I could look up struts-config from a TagSupport extension.
   




I should have been a bit more clear.  You *do* have access to the
configuration information that Struts read from the
struts-config.xmlfiles.  They are stored (if you only have one module)
under a servlet
context attribute named by symbolic constant Globals.MODULE_KEY (in a tag
handler you can call PageContext.getAttribute() to acquire it).

It's the create a JSP page dynamically and get it compiled part of the
problem that isn't going to work well.

Craig

 






-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Acessing TagHandlerPool for TagSupport

2006-02-19 Thread Steve Vanspall
I know this isn't specifically struts realted, but am having trouble 
finding a jasper mailing list.


Basically was wondering if I can have a custom tagsupport tag's 
doStartTag() method acess the taghandlerpool.


Basically i want ot be able to create a form, where neccesary, with a 
start tag.


but, like struts does, only know the action and parameters adn be able 
to look up what form I should be using.


Also it would help if I knew how many form were laready in use, and if a 
form tag was open, and hence can throw an error.


So basically, I could create a html:form within some code that this tag 
creates.


Alternatively, although not the most desirable option, is the a way to 
output html:form as part fo the start tag, and get the JSP to re 
evaluated it again.


Theres' probably a simple, duh!, solution coming my way, just can't seem 
to find the answer.


Thanks

Steve



-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]