JSF 2 and Post/Redirect/Get?

You could do this with a custom ConfigurableNavigationHandler. Here’s a kickoff example: package com.example; import java.util.Map; import java.util.Set; import javax.faces.application.ConfigurableNavigationHandler; import javax.faces.application.NavigationCase; import javax.faces.application.NavigationHandler; import javax.faces.context.FacesContext; public class RedirectNavigationHandler extends ConfigurableNavigationHandler { private NavigationHandler parent; public RedirectNavigationHandler(NavigationHandler parent) { this.parent = parent; } @Override public void handleNavigation(FacesContext context, String from, String outcome) { if (!outcome.endsWith(“?faces-redirect=true”)) … Read more

Spring MVC: Validation, Post-Redirect-Get, Partial Updates, Optimistic Concurrency, Field Security

To partially update an entity, you should use @SessionAttributes to store the model in session between requests. You could use hidden form fields, but session is more secure. To use P/R/G with validation, use flashAttributes To secure fields use webDataBinder.setAllowedFields(“field1″,”field2”,…) or create a class specific to the form then copy values to your entity. Entities … Read more

Post-Redirect-Get with ASP.NET

Typically you would do this by making an aspx web form that uses the querystring to signal which record to load/process. Let’s say you have a page that let’s you update some customer information: http://www.mysite.com/customer.aspx You would load the form using an id in the querystring: http://www.mysite.com/customer.aspx?CustomerId=42 In the codebehind you would have something like … Read more