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]

Reply via email to