I'm currently developing a web-app which will run under different domains and should behave and display differently there. Right now I'm using a combination of servlet/jsp but since I had an encounter with hibernate (which is really really great work) I thought I could give the framework from the same people a try.
What the app currently does:
1. (ContextBuilder) every request is piped through a servlet which builds a MyContext (domain/language/...) and then continues to
2. (Dispatcher) call -- depending on the MyContext and the request uri -- a fitting jsp page via the JspServlet.
3. The JspServlet renders the Page until it reaches something like:
<% Renderable r = Factry.getRenderable( "xyz" ); r.render( context, ... ) %>
(The "Renderable" object would be sth like an EntityBeans + the render Method. e.g. Person, Article, Xyz, ...)
Ok. Now to the interessting part:
4. (AreaRendering) depending on the MyContext and additional Parameters it chooses a renderable-xyz.jsp where the request is dispatched to again. The process of choosing the exact template.jsp is what all this is about since there are many parameters which I take into account: Language, domain, page, place, position in lists, user, type of rendarable and so on.
In addition this jsp is passed a reference to r as attribute 'self'. So there I use sth. like: <% Xyz self = request.getAttribute( 'self' );%><%=self.getName();%> or more complex operations on the entity. The process can go on from there unlimited.
So, why do I do it this way? It provides me with the maximum of configuration option which I need in this case. I can start a new Web simply by registering a new domain (and some little configuration) and then tell the application in a config file to:
* Render that component in this domain in another way or
* Call this other page when users are logged in or
* Use the English components for the .com domains
* Display the first entry of a list big and the rest of the list small
* many many more all by configuration.
Ok. Now to the real querstion: As I understand it seam depends on jsf which in turn has its own Servlet. There will be some processing and the jsf request queue seems pretty long. Is it possible to change my concept so that it works with seam? Can I chain jsf requests like I do with jsp an seam still works? Or is there a jsf mechanism I missed which can do what I want right out of the box?
Best regards & looking forward to answers