wood burning stoves 2.0*
The moose likes JSF and the fly likes JSF PrettyFaces Dynamic content? Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Murach's Java Servlets and JSP this week in the Servlets forum!
JavaRanch » Java Forums » Java » JSF
Bookmark "JSF PrettyFaces Dynamic content?" Watch "JSF PrettyFaces Dynamic content?" New topic
Author

JSF PrettyFaces Dynamic content?

mye kency
Greenhorn

Joined: May 09, 2010
Posts: 14
Hello Everybody!
i found PrettyFaces on google and choose it for my project
i want have dynamic page in one main page
it means

Page1 ==> include Header and Footer is static (include into Page1) , addition it have content, content will be dynamic with others page such as Register Page, Login Page, Item Page ...
Before i use JSF , i was use JSP and url when i get param such as
http://localhost/index.jsp?page=register.
http://localhost/index.jsp?page=login

and in index.jsp i can use if,else statement to choice page will be display inside index.jsp such as:




but now i use JSF and use Prettyfaces for Pretty URL how can i do dynamic content in one page like JSP?
Thank You
Best Regards
Tim Holloway
Saloon Keeper

Joined: Jun 25, 2001
Posts: 15949
    
  19

JSF is not JSP. So what you know about JSP may do you more harm than good.

JSF2 has built-in tiling facilities, for example. So it's easy to setup common page headers and footers. Also, since JSF is more of a true implementation of the Model/View/Controller paradigm that just about any web framework out there, you shouldn't be putting logic on the View (jsp). That's what Controllers are for.

I could rant at length on the whole idea of a dynamic logic page, since that implies that you're doing Do-It-Yourself webapp security and I strongly discourage that for most webapps. The J2EE framework security is more than sufficient for most webapps and a LOT more secure and it can automatically swap in login pages when they're needed. But that's another matter entirely.

If you're using PrettyFaces, you supply an action processor as part of the URL mapping in the pretty-config XML file. JSF actions return results that drive the navigation system, so you can select which page will be displayed based on what your action return value is.


Customer surveys are for companies who didn't pay proper attention to begin with.
Lincoln Baxter
Greenhorn

Joined: Aug 25, 2008
Posts: 24
This thread has been answered on the OcpSoft forums: http://ocpsoft.com/support/topic/dynamic-sub-view-with-pretty-faces?replies=10#post-520


Lincoln Baxter, III | [url]http://ocpsoft.com/[/url] | Creator of: PrettyFaces - Bookmarks, Navigation, and Dynamic Parameters for JSF
Tim Holloway
Saloon Keeper

Joined: Jun 25, 2001
Posts: 15949
    
  19

Note: my 10 fat little thumbs have betrayed me again. I meant to disparage dynamic login pages. Dynamic logic pages are bad enough, but - as I've said many times before - I've yet to run across a Do-It-Yourself security system that couldn't be cracked. Usually in under 10 minutes by relatively untalented people.
Lincoln Baxter
Greenhorn

Joined: Aug 25, 2008
Posts: 24
Tim,

I couldn't agree more. Definitely take a look at an existing security package before you try to create your own authentication/authorization system. You will likely miss something and create a vulnerable application.

--Lincoln
Tim Holloway
Saloon Keeper

Joined: Jun 25, 2001
Posts: 15949
    
  19

Forget "likely". Almost certainly. Even security professionals have been known to overlook things, and they have the tools and the training to do a much better job than people who are simply "clever".

However, if you have to put your money somewhere, it's a far better bet to go with the pros. Like I said, they have the resources to do a better job. Plus, they have the advantage that security isn't just another part of getting the product out - it is the product, so it gets undivided attention.

For anybody who really cares: Why Do-it-Yourself Java Security is a BAD THING.
mye kency
Greenhorn

Joined: May 09, 2010
Posts: 14
Thank you Tim and Lincoln , i'm student, i try to learn JSF and Pretty faces, sorry if my question is stupid think, i not have exp in web application before, but now i try to learn it
Thank for your advice !
 
Consider Paul's rocket mass heater.
 
subject: JSF PrettyFaces Dynamic content?
 
Similar Threads
doubts realted to include directive
Page not displaying
<jsp:include> Namespace
jsp:include corrupts characters
c:import with Facelets