I guess an alternative would be to simply write a *component* that
dynamically creates its child components based on data from the database.
Then you would be using a normal view-handler, with a page definition
that looks like:
<ui:whatever>
<xx:dbDrivenComponent db="..." def="..."/>
</ui:whatever>
and this custom component then creates the necessary children.
Regards,
Simon
Eugine F wrote:
Hello Simon,
Thanks I think you got me right. I want to let the viewhandler get all
the views from the databse. I would ceratainly be working with facelets.
The idea behind it is developing something liake a content management
system. I would now have a good look at JspViewHandlerImpl, FacesServlet
and LifecycleImpl. nBased on that I would try to see if I could
implement a custom view handler. I would let you know or come back to
you in case of difficulties. :) Thanks
Eugine
From: Simon Kitching <[EMAIL PROTECTED]>
Reply-To: "MyFaces Discussion" <[EMAIL PROTECTED]>
To: MyFaces Discussion <[EMAIL PROTECTED]>
Subject: Re: modifying faces servlet to let view be loaded from a data
base by default
Date: Thu, 12 Apr 2007 08:54:08 +1200
Hi Eugene,
Yes, ViewHandler is one of the main classes you need to look at
(JspViewHandlerImpl is the implemenation for JSP pages). Also look at
FacesServlet and LifecycleImpl. The code in these three classes is
pretty easy to understand.
You might want to read:
http://wiki.apache.org/myfaces/StudyGuide
I don't know any existing term for this so I'm going to use the phrase
"view definition" for something that defines what JSF components are
in a view.; "jsp files" and "facelets xtml files" are two examples.
If you wanted to get *all* your "view definitions" from a database
then I think that would be reasonably simple; just implement a new
ViewHandler and then register it in the faces-config file.
However if you want *some* of your "view definitions" to be from a
database, and some from the database depending on something in the
requested URL (eg prefix/suffix) then that might be a bit trickier.
I'm not aware of any built-in mechanism that allows different
ViewHandlers to be returned based on URL. I'm sure there's some way to
achieve this though. Maybe your custom ViewHandler can hold a
reference to a JspViewHandler, inspect the URL/viewId and decide
whether to handle the request itself or delegate to the underlying
implementation?
Regards,
Simon
Eugine F wrote:
Hello ,
The issue is the following; If I ask for a resource such as
"projects.jsp", the faces implementation implementation begins the
request prcessing life cycle. How does the faces implementation go
about getting this resource. Which class is responsible for the
search of this resource and at what stage of the life cycle? I would
like to know if it is the viewHandler and if possible the method that
takes care of this process. With this knowledge I would then like to
influence the behaviour or customize it.
Thanks
From: "Volker Weber" <[EMAIL PROTECTED]>
Reply-To: "MyFaces Discussion" <[EMAIL PROTECTED]>
To: "MyFaces Discussion" <[EMAIL PROTECTED]>
Subject: Re: modifying faces servlet to let view be loaded from a
data base by default
Date: Wed, 11 Apr 2007 09:57:18 +0200
Hi,
you can use the binding on a panel tag, and create the content in
your app.
regards,
Volker
2007/4/11, Eugine F <[EMAIL PROTECTED]>:
Hello users,
I would like to have a clue as to how I could modify the faces
servlet or
the component that I have to modify to let the view be loaded form
a data
base. Anyone has an idea?
thanks
Eugine
_________________________________________________________________
Wenn Ihnen E-Mail nicht schnell genug ist: MSN Messenger! -
http://www.imagine-msn.com/messenger/default2.aspx?locale=de Kostenlos
downloaden!
_________________________________________________________________
Ihr Blog. Ihre Fotos. Ihre Erlebnisse. Jetzt auf MSN Spaces. -
http://spaces.msn.com/SignUp.aspx Jetzt anmelden!
_________________________________________________________________
Wenn Ihnen E-Mail nicht schnell genug ist: MSN Messenger! -
http://www.imagine-msn.com/messenger/default2.aspx?locale=de Kostenlos
downloaden!