0

I still wasn't able to find a solution for this JSF 2.x problem:

  • Is it possible for a JSF page running at .../myapp/page-manager.html to create a whole new JSF page .../myapp/new-page1.html (page definition made via page manager and stored in backend db) and to add the generated page to the existing (exploded) WAR structure (or at least hold it in memory) to be served?

Please note:
It's about creating an entire new page that FacesServlet can handle like any regular page, and NOT about how to change some components on a pre-existing page on the fly and backed in a db. The latter is only a part of the problem.

I'd be very glad to obtain some helpful tips asap (due to its importance in a current project).
Thanks a lot, Natalia.

  • Short answer is yes you can. The question is what are you trying to achieve there might be a shorter path. – Sully May 11 '12 at 16:14
  • Basically I want an app letting some people register for an "editors account" and then, within an (statically) existing admin console, let them create a few new pages for promoting themselves and publish some offers. Thus, each registered person will have functions like "add new page", "set layout for page", "set theme for all pages", etc. ... These set of dynamic **entire pages** are then to be dispatched by JSF to their customers the way that JSF would do traditionally (in the only-pre-existing-pages use case). – Natalia Fernandez May 14 '12 at 10:37
  • I forgot to mention that the editors will have a kind of WYSIWYG HTML editor to put some content within content components on the new page. For slightly more details on this scenario, please see my 1st question [here](http://stackoverflow.com/questions/10485458/design-architecture-for-a-content-editors-jee-6-web-app). Thank you very much for any help. – Natalia Fernandez May 14 '12 at 10:54
  • Really no suggestions here?!? – Natalia Fernandez May 21 '12 at 12:00
  • The answer you want is here http://stackoverflow.com/a/3522489/643500 at step 2 basically all you want is to create the HTML elements from the bean and put them in the page. This might be a performance constraint though. – Sully May 21 '12 at 16:17
  • @D3mon-1stVFW: Is the issue treated in your provided link really the same? As I stated above, I guess I'll have to, first, deal with the creation of new .jsf or .xhtml files **within an already deployed web app** (.war or exploded .war), and then, in a 2nd step, load the appropriate HTML components to these created "carrier documents", wont't I? Thus, I think for step 2 you're right. But how to handle step 1??? – Natalia Fernandez May 22 '12 at 10:17
  • I think you can achieve that without pushing new html pages you can have a place holder in the page that will be populated based on the logic instead of new pages – Sully May 22 '12 at 14:46
  • @D3mon-1stVFW: You mean ... having just **1** physical, pre-defined page in each member's context (e.g. document root of each registered member that are allowed to publish a pageset in a "sub-context") to serve??? And then, as usual for dynamic cases, this single page would only have a top-level 'PanelGroup' with a 'binding' like ``, the bean returning the then entirely populated panel??? Is this one-page scenario what you meant? I so, I guess it could work. Good idea! ;-) – Natalia Fernandez May 23 '12 at 14:23
  • Yes, that was the idea. It should be the more flexible and it should make it simpler to customize. Start with a basic template and inherit it in other ones, depends how you will design it. Good luck. – Sully May 23 '12 at 17:57

0 Answers0