As Mikolaj pointed out, there is absolutely no way to do this that will be 
compatible across containers.

And, even for Tomcat only, this isn't going to be easy.  Tomcat (or, more 
correctly Jasper) doesn't publish this information in any form that can be 
reliably read (e.g. JMX).  Partially this is because the class name may 
change if you are running in developement mode (where it re-compiles changed 
JSP pages on the fly).

I can think of various sordid container-specific hacks based on 
getClassLoader().getResources(...), but I'm sure that you can think of them 
too ;).  If this was for one webapp, then I'd just pre-compile all the JSP 
pages before deploying, and have a catalog that maps servlet-path to 
classname.  For a framework, I can't think of anything better than a 
ResponseWrapper that handles requests with reserved query-strings.  But this 
is ugly enough, that personally I'd just stick with the separate .xml file.

"Simon Kitching" <[EMAIL PROTECTED]> wrote in message 
news:[EMAIL PROTECTED]
> Mikolaj Rydzewski schrieb:
>
>> > Simon Kitching wrote:
>>
>>> >> Or perhaps someone can suggest an alternate approach to embedding 
>>> >> metadata that can be accessed before the page renders?
>>>     Please provide as with more details, at this point your requirement 
>>> is a little bit strange. Have you considered using filters?
>> >
>>
> Ok, here are some more details.
>
> I'm working on the myfaces orchestra flow project (for JavaServer Faces, 
> aka JSF). It allows one JSF page to "call" another JSF page like a 
> subroutine, passing parameters and allows the called page(s) to simply 
> "return" to the page that called them, passing back results. This makes 
> navigation between pages easier, makes the data passing explicit, and 
> avoids any potential variablename "collisions" by setting up a completely 
> clean scope for the called page to run in, with only the passed variables 
> visible.
>
> When a "call" to a page is done, the page from which the call is made must 
> declare metadata about what the parameters to be passed are, and what 
> logical "service" the called page provides. The called page also needs to 
> declare what input parameters it expects, and what logical service it 
> provides. Think of this like a Java method "prototype" (which is also 
> metadata, and can be queried via java reflection).
>
> The code where this metadata is needed is in a JSF ViewHandler, which is 
> indirectly called from the JSF FacesServlet class, after the user has 
> submitted a form. The metadata is used for sanity-checking of the call and 
> setting up of the passed parameters (rearrangement of variables in the 
> http session scope etc). Then a forward to the "called" page is done.
>
> As described in the original email, this is currently done by looking for 
> a ".xml" file sitting beside each .jsp. It works ok, and for any JSF view 
> mechanism (jsp, facelets, clay, etc). But some people might find embedding 
> the information in the actual page to be nicer to work with. Doing this 
> with Facelets isn't too hard, but embedding the necessary info into a jsp 
> page is straining my jsp knowledge considerably  :-)
> However I think the issue is a generic one, not anything specific to this 
> particular case: I want to add "metadata" to a jsp page, just like java 
> annotations provide static metadata about a class without needing to 
> create an instance and execute it. I would think that being able to 
> "annotate" a jsp would be useful for many purposes.
>
> Regards,
> Simon
>
>
>
>
> ---------------------------------------------------------------------
> To start a new topic, e-mail: users@tomcat.apache.org
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
>
> 




---------------------------------------------------------------------
To start a new topic, e-mail: users@tomcat.apache.org
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to