DZone
Java Zone
Thanks for visiting DZone today,
Edit Profile
  • Manage Email Subscriptions
  • How to Post to DZone
  • Article Submission Guidelines
Sign Out View Profile
  • Post an Article
  • Manage My Drafts
Over 2 million developers have joined DZone.
Log In / Join
  • Refcardz
  • Trend Reports
  • Webinars
  • Zones
  • |
    • Agile
    • AI
    • Big Data
    • Cloud
    • Database
    • DevOps
    • Integration
    • IoT
    • Java
    • Microservices
    • Open Source
    • Performance
    • Security
    • Web Dev
DZone > Java Zone > HTTP GET, URL Rewriting, Multi Component Validation, and EL Method Invocation in JSF

HTTP GET, URL Rewriting, Multi Component Validation, and EL Method Invocation in JSF

Ryan Developer user avatar by
Ryan Developer
·
Feb. 05, 09 · Java Zone · Interview
Like (0)
Save
Tweet
10.10K Views

Join the DZone community and get the full member experience.

Join For Free

There is a project called Pretty Faces that adds HTTP GET and URL Rewriting to JSF 1.2. The project differentiates itself from JBoss Seam, RESTfaces and PrettyUrlPhaseListener by making the h:form tag submit to the pretty URL (/mapped/page) instead of the view Id (/faces/page.jsf). For a detailed description of why you should choose Pretty Faces instead of the others for HTTP GET and URL Rewriting in JSF 1.2, read this article on the OcpSoft website.

I contributed an initial Maven2 POM and directory layout to help the project owner get it into the central repository. The work is complete, and it looks like I've helped convert him into a Maven2 fan :)

I've been lobbying the JSF 2.0 expert group to add HTTP GET support for a while. Someone told me that Red Hat has donated additional resources (aka people) to the effort to make sure it gets done for JSF 2.0. I suggested that they get the author of Pretty Faces involved in the design or at least learn from his project because he thinks that he has done something above and beyond the current solutions. The expert group did contact him and he helped review several revision of the HTTP GET support that will soon be in the spec. He is happy with the way it turned out, and says that he is sure that HTTP GET will be in JSF 2.0.

The 1.x releases of Pretty Faces targets JSF 1.2, and the future 2.x releases will target JSF 2.0. The 2.x releases will likely have the HTTP GET feature stripped out leaving only the URL Rewriting feature, because JSF 2.0 will come with HTTP GET built in.

I have other good news related to JSF 2.0. For a long time I've been lobbying the JSF 2.0 and Java EE 6 expert groups for multi component validation support. I recently discovered someone's blog from 2004 suggesting that h:form supports validators like any other component. In the validator you could read the submitted values of any combination of input components and perform business validation. I recently summarized the idea and provided a link to the expert group. Today there were several commits on the multi component validation ticket in IssueZilla, and it shows that they implemented something similar but different. They found a way to take advantage of the new events feature in JSF 2.0. UIComponents will have a beforeValidate and afterValidate event. You can catch the h:form's afterValidate event, load the submitted values from the components you are interested in, validate them using business rules, add FacesMessages into FacesContext, then call renderResponse(). I imagine someone will be blogging about this feature and the HTTP GET support soon.

Browsing the blogsphere today I discovered even more good news. EL method invocation will be present in Java EE 6!

I have one last bit of news related to JSF 2.0. The RichFaces team is working on a version that uses JSF 2.0's new features, and they will be removing things that are no longer necessary such as Ajax4JSF.

From http://www.ryandelaplante.com

 

Java EE Release (agency) News Event Java (programming language) teams JBoss Advantage (cryptography)

Opinions expressed by DZone contributors are their own.

Popular on DZone

  • Artificial Intelligence (AI) And Its Assistance in Medical Diagnosis
  • What Developers Need to Know About Table Partition Pruning
  • Kubernetes Service Types Explained In-Detail
  • Version Number Anti-Patterns

Comments

Java Partner Resources

X

ABOUT US

  • About DZone
  • Send feedback
  • Careers
  • Sitemap

ADVERTISE

  • Advertise with DZone

CONTRIBUTE ON DZONE

  • Article Submission Guidelines
  • MVB Program
  • Become a Contributor
  • Visit the Writers' Zone

LEGAL

  • Terms of Service
  • Privacy Policy

CONTACT US

  • 600 Park Offices Drive
  • Suite 300
  • Durham, NC 27709
  • support@dzone.com
  • +1 (919) 678-0300

Let's be friends:

DZone.com is powered by 

AnswerHub logo