diff --git a/spring-faces/src/main/java/org/springframework/faces/support/RequestLoggingPhaseListener.java b/spring-faces/src/main/java/org/springframework/faces/support/RequestLoggingPhaseListener.java index f8c6d8f9..6e2a5e59 100644 --- a/spring-faces/src/main/java/org/springframework/faces/support/RequestLoggingPhaseListener.java +++ b/spring-faces/src/main/java/org/springframework/faces/support/RequestLoggingPhaseListener.java @@ -7,6 +7,13 @@ import javax.faces.event.PhaseListener; import org.apache.commons.logging.Log; import org.apache.commons.logging.LogFactory; +/** + * {@link PhaseListener} that logs the execution of the individual phases of the JSF lifecycle. Useful during JSF + * application development in order to detect unreported JSF errors that cause the lifecycle to short-circuit. Turn + * logging level to DEBUG to see its output. + * + * @author Jeremy Grelle + */ public class RequestLoggingPhaseListener implements PhaseListener { private Log logger = LogFactory.getLog(RequestLoggingPhaseListener.class); @@ -16,7 +23,9 @@ public class RequestLoggingPhaseListener implements PhaseListener { } public void beforePhase(PhaseEvent event) { - logger.debug("Entering JSF Phase: " + event.getPhaseId()); + if (logger.isDebugEnabled()) { + logger.debug("Entering JSF Phase: " + event.getPhaseId()); + } } public PhaseId getPhaseId() { diff --git a/spring-faces/src/main/java/org/springframework/faces/ui/DojoAdvisor.java b/spring-faces/src/main/java/org/springframework/faces/ui/DojoAdvisor.java index fdfcc882..ef887a5b 100644 --- a/spring-faces/src/main/java/org/springframework/faces/ui/DojoAdvisor.java +++ b/spring-faces/src/main/java/org/springframework/faces/ui/DojoAdvisor.java @@ -1,3 +1,18 @@ +/* + * Copyright 2004-2007 the original author or authors. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ package org.springframework.faces.ui; import javax.el.ValueExpression; diff --git a/spring-faces/src/main/java/org/springframework/faces/ui/DojoAdvisorRenderer.java b/spring-faces/src/main/java/org/springframework/faces/ui/DojoAdvisorRenderer.java index 8800ab84..28a171b4 100644 --- a/spring-faces/src/main/java/org/springframework/faces/ui/DojoAdvisorRenderer.java +++ b/spring-faces/src/main/java/org/springframework/faces/ui/DojoAdvisorRenderer.java @@ -1,3 +1,18 @@ +/* + * Copyright 2004-2007 the original author or authors. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ package org.springframework.faces.ui; import java.io.IOException; diff --git a/spring-faces/src/main/java/org/springframework/faces/ui/DojoClientCurrencyValidator.java b/spring-faces/src/main/java/org/springframework/faces/ui/DojoClientCurrencyValidator.java index 7d280cde..1a86e0d7 100644 --- a/spring-faces/src/main/java/org/springframework/faces/ui/DojoClientCurrencyValidator.java +++ b/spring-faces/src/main/java/org/springframework/faces/ui/DojoClientCurrencyValidator.java @@ -1,3 +1,18 @@ +/* + * Copyright 2004-2007 the original author or authors. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ package org.springframework.faces.ui; import javax.el.ValueExpression; diff --git a/spring-faces/src/main/java/org/springframework/faces/ui/DojoClientDateValidator.java b/spring-faces/src/main/java/org/springframework/faces/ui/DojoClientDateValidator.java index ce4d2ddc..5cf16ce4 100644 --- a/spring-faces/src/main/java/org/springframework/faces/ui/DojoClientDateValidator.java +++ b/spring-faces/src/main/java/org/springframework/faces/ui/DojoClientDateValidator.java @@ -1,3 +1,18 @@ +/* + * Copyright 2004-2007 the original author or authors. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ package org.springframework.faces.ui; public class DojoClientDateValidator extends DojoAdvisor { diff --git a/spring-faces/src/main/java/org/springframework/faces/ui/DojoClientNumberValidator.java b/spring-faces/src/main/java/org/springframework/faces/ui/DojoClientNumberValidator.java index bc81cbbb..4faf7cc2 100644 --- a/spring-faces/src/main/java/org/springframework/faces/ui/DojoClientNumberValidator.java +++ b/spring-faces/src/main/java/org/springframework/faces/ui/DojoClientNumberValidator.java @@ -1,3 +1,18 @@ +/* + * Copyright 2004-2007 the original author or authors. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ package org.springframework.faces.ui; public class DojoClientNumberValidator extends DojoAdvisor { diff --git a/spring-faces/src/main/java/org/springframework/faces/ui/DojoClientTextValidator.java b/spring-faces/src/main/java/org/springframework/faces/ui/DojoClientTextValidator.java index 1a504a3e..bfa02940 100644 --- a/spring-faces/src/main/java/org/springframework/faces/ui/DojoClientTextValidator.java +++ b/spring-faces/src/main/java/org/springframework/faces/ui/DojoClientTextValidator.java @@ -1,3 +1,18 @@ +/* + * Copyright 2004-2007 the original author or authors. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ package org.springframework.faces.ui; public class DojoClientTextValidator extends DojoAdvisor { diff --git a/spring-faces/src/main/java/org/springframework/faces/ui/DojoRenderer.java b/spring-faces/src/main/java/org/springframework/faces/ui/DojoRenderer.java index be1fa230..adce0a19 100644 --- a/spring-faces/src/main/java/org/springframework/faces/ui/DojoRenderer.java +++ b/spring-faces/src/main/java/org/springframework/faces/ui/DojoRenderer.java @@ -1,3 +1,18 @@ +/* + * Copyright 2004-2007 the original author or authors. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ package org.springframework.faces.ui; import java.io.IOException; diff --git a/spring-faces/src/main/java/org/springframework/faces/ui/ExtAdvisor.java b/spring-faces/src/main/java/org/springframework/faces/ui/ExtAdvisor.java index 687b8311..65638422 100644 --- a/spring-faces/src/main/java/org/springframework/faces/ui/ExtAdvisor.java +++ b/spring-faces/src/main/java/org/springframework/faces/ui/ExtAdvisor.java @@ -1,3 +1,18 @@ +/* + * Copyright 2004-2007 the original author or authors. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ package org.springframework.faces.ui; import javax.el.ValueExpression; diff --git a/spring-faces/src/main/java/org/springframework/faces/ui/ExtAdvisorRenderer.java b/spring-faces/src/main/java/org/springframework/faces/ui/ExtAdvisorRenderer.java index c8747b5a..a8b32085 100644 --- a/spring-faces/src/main/java/org/springframework/faces/ui/ExtAdvisorRenderer.java +++ b/spring-faces/src/main/java/org/springframework/faces/ui/ExtAdvisorRenderer.java @@ -1,3 +1,18 @@ +/* + * Copyright 2004-2007 the original author or authors. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ package org.springframework.faces.ui; import java.io.IOException; diff --git a/spring-faces/src/main/java/org/springframework/faces/ui/ExtClientDateValidator.java b/spring-faces/src/main/java/org/springframework/faces/ui/ExtClientDateValidator.java index 7bef553c..f7780925 100644 --- a/spring-faces/src/main/java/org/springframework/faces/ui/ExtClientDateValidator.java +++ b/spring-faces/src/main/java/org/springframework/faces/ui/ExtClientDateValidator.java @@ -1,3 +1,18 @@ +/* + * Copyright 2004-2007 the original author or authors. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ package org.springframework.faces.ui; import javax.faces.context.FacesContext; diff --git a/spring-faces/src/main/java/org/springframework/faces/ui/ExtClientNumberValidator.java b/spring-faces/src/main/java/org/springframework/faces/ui/ExtClientNumberValidator.java index de9c1e82..1c69cd0a 100644 --- a/spring-faces/src/main/java/org/springframework/faces/ui/ExtClientNumberValidator.java +++ b/spring-faces/src/main/java/org/springframework/faces/ui/ExtClientNumberValidator.java @@ -1,3 +1,18 @@ +/* + * Copyright 2004-2007 the original author or authors. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ package org.springframework.faces.ui; import javax.faces.context.FacesContext; diff --git a/spring-faces/src/main/java/org/springframework/faces/ui/ExtClientTextValidator.java b/spring-faces/src/main/java/org/springframework/faces/ui/ExtClientTextValidator.java index eb62e1b0..bbd798a4 100644 --- a/spring-faces/src/main/java/org/springframework/faces/ui/ExtClientTextValidator.java +++ b/spring-faces/src/main/java/org/springframework/faces/ui/ExtClientTextValidator.java @@ -1,3 +1,18 @@ +/* + * Copyright 2004-2007 the original author or authors. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ package org.springframework.faces.ui; import javax.faces.context.FacesContext; diff --git a/spring-faces/src/main/java/org/springframework/faces/ui/ExtJsComponent.java b/spring-faces/src/main/java/org/springframework/faces/ui/ExtJsComponent.java index aed4b7a1..15b29ca0 100644 --- a/spring-faces/src/main/java/org/springframework/faces/ui/ExtJsComponent.java +++ b/spring-faces/src/main/java/org/springframework/faces/ui/ExtJsComponent.java @@ -1,3 +1,18 @@ +/* + * Copyright 2004-2007 the original author or authors. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ package org.springframework.faces.ui; import javax.faces.component.UIComponentBase; diff --git a/spring-faces/src/main/java/org/springframework/faces/ui/ExtJsRenderer.java b/spring-faces/src/main/java/org/springframework/faces/ui/ExtJsRenderer.java index add8d2b3..bcb641d2 100644 --- a/spring-faces/src/main/java/org/springframework/faces/ui/ExtJsRenderer.java +++ b/spring-faces/src/main/java/org/springframework/faces/ui/ExtJsRenderer.java @@ -1,3 +1,18 @@ +/* + * Copyright 2004-2007 the original author or authors. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ package org.springframework.faces.ui; import java.io.IOException; diff --git a/spring-faces/src/main/java/org/springframework/faces/ui/SpringFacesRenderer.java b/spring-faces/src/main/java/org/springframework/faces/ui/SpringFacesRenderer.java index 9b811cc4..2a5c22d9 100644 --- a/spring-faces/src/main/java/org/springframework/faces/ui/SpringFacesRenderer.java +++ b/spring-faces/src/main/java/org/springframework/faces/ui/SpringFacesRenderer.java @@ -1,3 +1,18 @@ +/* + * Copyright 2004-2007 the original author or authors. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ package org.springframework.faces.ui; import java.io.IOException; diff --git a/spring-faces/src/main/java/org/springframework/faces/ui/ValidateAll.java b/spring-faces/src/main/java/org/springframework/faces/ui/ValidateAll.java index 792b6d56..100ac81a 100644 --- a/spring-faces/src/main/java/org/springframework/faces/ui/ValidateAll.java +++ b/spring-faces/src/main/java/org/springframework/faces/ui/ValidateAll.java @@ -1,3 +1,18 @@ +/* + * Copyright 2004-2007 the original author or authors. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ package org.springframework.faces.ui; import javax.faces.component.UIComponentBase; diff --git a/spring-faces/src/main/java/org/springframework/faces/ui/ValidateAllRenderer.java b/spring-faces/src/main/java/org/springframework/faces/ui/ValidateAllRenderer.java index f65e3fd3..58ba3d3b 100644 --- a/spring-faces/src/main/java/org/springframework/faces/ui/ValidateAllRenderer.java +++ b/spring-faces/src/main/java/org/springframework/faces/ui/ValidateAllRenderer.java @@ -1,3 +1,18 @@ +/* + * Copyright 2004-2007 the original author or authors. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ package org.springframework.faces.ui; import java.io.IOException; diff --git a/spring-faces/src/main/java/org/springframework/faces/webflow/FlowActionListener.java b/spring-faces/src/main/java/org/springframework/faces/webflow/FlowActionListener.java index e161f78e..9d75efe5 100644 --- a/spring-faces/src/main/java/org/springframework/faces/webflow/FlowActionListener.java +++ b/spring-faces/src/main/java/org/springframework/faces/webflow/FlowActionListener.java @@ -1,5 +1,21 @@ +/* + * Copyright 2004-2007 the original author or authors. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ package org.springframework.faces.webflow; +import javax.faces.application.NavigationHandler; import javax.faces.component.ActionSource; import javax.faces.context.FacesContext; import javax.faces.event.AbortProcessingException; @@ -8,6 +24,14 @@ import javax.faces.event.ActionListener; import org.springframework.util.StringUtils; +/** + * The default {@link ActionListener} implementation to be used with Web Flow. + *

+ * This implementation bypasses the JSF {@link NavigationHandler} mechanism to instead let the event be handled directly + * by Web Flow. + * + * @author Jeremy Grelle + */ public class FlowActionListener implements ActionListener { public void processAction(ActionEvent actionEvent) throws AbortProcessingException { diff --git a/spring-faces/src/main/java/org/springframework/faces/webflow/FlowExecutionViewHandler.java b/spring-faces/src/main/java/org/springframework/faces/webflow/FlowExecutionViewHandler.java index 50a068b4..1daffaf6 100644 --- a/spring-faces/src/main/java/org/springframework/faces/webflow/FlowExecutionViewHandler.java +++ b/spring-faces/src/main/java/org/springframework/faces/webflow/FlowExecutionViewHandler.java @@ -1,3 +1,18 @@ +/* + * Copyright 2004-2007 the original author or authors. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ package org.springframework.faces.webflow; import java.io.IOException; @@ -10,6 +25,12 @@ import javax.faces.context.FacesContext; import org.springframework.webflow.execution.RequestContextHolder; +/** + * Simple delegating {@link ViewHandler} implementation that provides JSF Form's with the correct FlowExecution URL, + * including the current FlowExecutionKey, so that postbacks may be properly intercepted and handled by Web Flow. + * + * @author Jeremy Grelle + */ public class FlowExecutionViewHandler extends ViewHandler { ViewHandler delegate; diff --git a/spring-faces/src/main/java/org/springframework/faces/webflow/FlowFacesContext.java b/spring-faces/src/main/java/org/springframework/faces/webflow/FlowFacesContext.java index 4a120ce2..9650644e 100644 --- a/spring-faces/src/main/java/org/springframework/faces/webflow/FlowFacesContext.java +++ b/spring-faces/src/main/java/org/springframework/faces/webflow/FlowFacesContext.java @@ -1,3 +1,18 @@ +/* + * Copyright 2004-2007 the original author or authors. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ package org.springframework.faces.webflow; import java.util.Iterator; @@ -16,9 +31,16 @@ import org.springframework.binding.message.Message; import org.springframework.binding.message.MessageResolver; import org.springframework.binding.message.Messages; import org.springframework.binding.message.Severity; +import org.springframework.context.MessageSource; import org.springframework.util.StringUtils; import org.springframework.webflow.execution.RequestContextHolder; +/** + * Custom {@link FacesContext} implementation that delegates all standard FacesContext messaging functionality to a + * Spring {@link MessageSource} made accessible as part of the current Web Flow request. + * + * @author Jeremy Grelle + */ public class FlowFacesContext extends FacesContext { /** diff --git a/spring-faces/src/main/java/org/springframework/faces/webflow/FlowFacesContextFactory.java b/spring-faces/src/main/java/org/springframework/faces/webflow/FlowFacesContextFactory.java index 1bc47683..29e3ed78 100644 --- a/spring-faces/src/main/java/org/springframework/faces/webflow/FlowFacesContextFactory.java +++ b/spring-faces/src/main/java/org/springframework/faces/webflow/FlowFacesContextFactory.java @@ -1,3 +1,18 @@ +/* + * Copyright 2004-2007 the original author or authors. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ package org.springframework.faces.webflow; import javax.faces.FacesException; @@ -5,6 +20,14 @@ import javax.faces.context.FacesContext; import javax.faces.context.FacesContextFactory; import javax.faces.lifecycle.Lifecycle; +import org.springframework.context.MessageSource; + +/** + * {@link FacesContextFactory} implementation that installs the {@link FlowFacesContext}, allowing for integration with + * a Spring {@link MessageSource}. + * + * @author Jeremy Grelle + */ public class FlowFacesContextFactory extends FacesContextFactory { FacesContextFactory delegate; diff --git a/spring-faces/src/main/java/org/springframework/faces/webflow/FlowLifecycle.java b/spring-faces/src/main/java/org/springframework/faces/webflow/FlowLifecycle.java index 274eff5c..0f7c7a43 100644 --- a/spring-faces/src/main/java/org/springframework/faces/webflow/FlowLifecycle.java +++ b/spring-faces/src/main/java/org/springframework/faces/webflow/FlowLifecycle.java @@ -1,3 +1,18 @@ +/* + * Copyright 2004-2007 the original author or authors. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ package org.springframework.faces.webflow; import javax.faces.FacesException; @@ -6,6 +21,15 @@ import javax.faces.event.PhaseId; import javax.faces.event.PhaseListener; import javax.faces.lifecycle.Lifecycle; +/** + * Custom {@link Lifecycle} for Spring Web Flow that only executes the APPLY_REQUEST_VALUES through INVOKE_APPLICATION + * phases. + *

+ * This Lifecycle does not execute the RESTORE_VIEW phase since view creation and restoration are now handled by the + * {@link JsfViewFactory}. + * + * @author Jeremy Grelle + */ public class FlowLifecycle extends Lifecycle { private final Lifecycle delegate; @@ -27,18 +51,30 @@ public class FlowLifecycle extends Lifecycle { } } + /** + * Delegates to the wrapped {@link Lifecycle}. + */ public void render(FacesContext context) throws FacesException { delegate.render(context); } + /** + * Delegates to the wrapped {@link Lifecycle}. + */ public void addPhaseListener(PhaseListener listener) { delegate.addPhaseListener(listener); } + /** + * Delegates to the wrapped {@link Lifecycle}. + */ public PhaseListener[] getPhaseListeners() { return delegate.getPhaseListeners(); } + /** + * Delegates to the wrapped {@link Lifecycle}. + */ public void removePhaseListener(PhaseListener listener) { delegate.removePhaseListener(listener); } diff --git a/spring-faces/src/main/java/org/springframework/faces/webflow/FlowLifecycleFactory.java b/spring-faces/src/main/java/org/springframework/faces/webflow/FlowLifecycleFactory.java index 6aaf7938..14a5b1bf 100644 --- a/spring-faces/src/main/java/org/springframework/faces/webflow/FlowLifecycleFactory.java +++ b/spring-faces/src/main/java/org/springframework/faces/webflow/FlowLifecycleFactory.java @@ -1,3 +1,18 @@ +/* + * Copyright 2004-2007 the original author or authors. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ package org.springframework.faces.webflow; import java.util.Iterator; @@ -5,6 +20,15 @@ import java.util.Iterator; import javax.faces.lifecycle.Lifecycle; import javax.faces.lifecycle.LifecycleFactory; +/** + * This {@link LifecycleFactory} implementation is responsible for installing a custom JSF Lifecycle the executes within + * the context of Spring Web Flow. + *

+ * The {@link FlowLifecycle} will be configured to delegate to the default {@link Lifecycle} where custom behavior is + * not needed. + * + * @author Jeremy Grelle + */ public class FlowLifecycleFactory extends LifecycleFactory { public static final String FLOW_LIFECYCLE_ID = "org.springframework.FlowLifecycle"; @@ -24,7 +48,7 @@ public class FlowLifecycleFactory extends LifecycleFactory { return delegate.getLifecycle(lifecycleId); } - public Iterator getLifecycleIds() { + public Iterator getLifecycleIds() { return delegate.getLifecycleIds(); } diff --git a/spring-faces/src/main/java/org/springframework/faces/webflow/FlowRenderKitFactory.java b/spring-faces/src/main/java/org/springframework/faces/webflow/FlowRenderKitFactory.java index 74df882e..9ea9f587 100644 --- a/spring-faces/src/main/java/org/springframework/faces/webflow/FlowRenderKitFactory.java +++ b/spring-faces/src/main/java/org/springframework/faces/webflow/FlowRenderKitFactory.java @@ -1,3 +1,18 @@ +/* + * Copyright 2004-2007 the original author or authors. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ package org.springframework.faces.webflow; import java.util.Iterator; @@ -6,6 +21,12 @@ import javax.faces.context.FacesContext; import javax.faces.render.RenderKit; import javax.faces.render.RenderKitFactory; +/** + * {@link RenderKitFactory} implementation that wraps the current {@link RenderKit} implementation inside the + * {@link FlowRenderKitWrapper}. + * + * @author Jeremy Grelle + */ public class FlowRenderKitFactory extends RenderKitFactory { private RenderKitFactory delegate; diff --git a/spring-faces/src/main/java/org/springframework/faces/webflow/FlowRenderKitWrapper.java b/spring-faces/src/main/java/org/springframework/faces/webflow/FlowRenderKitWrapper.java index 8fb99c9c..fb99f98e 100644 --- a/spring-faces/src/main/java/org/springframework/faces/webflow/FlowRenderKitWrapper.java +++ b/spring-faces/src/main/java/org/springframework/faces/webflow/FlowRenderKitWrapper.java @@ -1,3 +1,18 @@ +/* + * Copyright 2004-2007 the original author or authors. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ package org.springframework.faces.webflow; import java.io.OutputStream; @@ -9,6 +24,12 @@ import javax.faces.render.RenderKit; import javax.faces.render.Renderer; import javax.faces.render.ResponseStateManager; +/** + * Delegating {@link RenderKit} implementation that provides a custom {@link ResponseStateManager} for storing JSF view + * state as part of the current FlowExecution. + * + * @author Jeremy Grelle + */ public class FlowRenderKitWrapper extends RenderKit { RenderKit delegate; diff --git a/spring-faces/src/main/java/org/springframework/faces/webflow/FlowResponseStateManager.java b/spring-faces/src/main/java/org/springframework/faces/webflow/FlowResponseStateManager.java index 7da40538..45e9e1e1 100644 --- a/spring-faces/src/main/java/org/springframework/faces/webflow/FlowResponseStateManager.java +++ b/spring-faces/src/main/java/org/springframework/faces/webflow/FlowResponseStateManager.java @@ -1,3 +1,18 @@ +/* + * Copyright 2004-2007 the original author or authors. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ package org.springframework.faces.webflow; import java.io.IOException; @@ -9,8 +24,15 @@ import javax.faces.context.FacesContext; import javax.faces.render.ResponseStateManager; import org.springframework.webflow.execution.FlowExecution; +import org.springframework.webflow.execution.FlowExecutionKey; import org.springframework.webflow.execution.RequestContextHolder; +/** + * {@link ResponseStateManager} implementation that writes out the current {@link FlowExecutionKey} in place of the JSF + * view state, and manages the JSF view state as part of the FlowExecution instance state. + * + * @author Jeremy Grelle + */ public class FlowResponseStateManager extends ResponseStateManager { private static final int VIEW_ID_INDEX = 0; diff --git a/spring-faces/src/main/java/org/springframework/faces/webflow/JsfFlowUtils.java b/spring-faces/src/main/java/org/springframework/faces/webflow/JsfFlowUtils.java index 1a2d42b0..4510f6c0 100644 --- a/spring-faces/src/main/java/org/springframework/faces/webflow/JsfFlowUtils.java +++ b/spring-faces/src/main/java/org/springframework/faces/webflow/JsfFlowUtils.java @@ -1,3 +1,18 @@ +/* + * Copyright 2004-2007 the original author or authors. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ package org.springframework.faces.webflow; import javax.faces.FactoryFinder; @@ -11,6 +26,11 @@ import javax.faces.lifecycle.Lifecycle; import org.springframework.webflow.execution.RequestContext; import org.springframework.webflow.execution.RequestContextHolder; +/** + * Common support for the JSF integration with Spring Web Flow. + * + * @author Jeremy Grelle + */ class JsfFlowUtils { public static FacesContext getFacesContext(Lifecycle lifecycle) { diff --git a/spring-faces/src/main/java/org/springframework/faces/webflow/JsfRenderFinalResponseAction.java b/spring-faces/src/main/java/org/springframework/faces/webflow/JsfRenderFinalResponseAction.java index 5875f04a..0ac786cd 100644 --- a/spring-faces/src/main/java/org/springframework/faces/webflow/JsfRenderFinalResponseAction.java +++ b/spring-faces/src/main/java/org/springframework/faces/webflow/JsfRenderFinalResponseAction.java @@ -1,12 +1,38 @@ +/* + * Copyright 2004-2007 the original author or authors. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ package org.springframework.faces.webflow; +import javax.faces.component.UIViewRoot; + import org.springframework.util.Assert; +import org.springframework.webflow.engine.EndState; import org.springframework.webflow.execution.Action; import org.springframework.webflow.execution.Event; import org.springframework.webflow.execution.RequestContext; import org.springframework.webflow.execution.View; import org.springframework.webflow.execution.ViewFactory; +/** + * Specialized {@link Action} implementation for rendering the JSF view in an {@link EndState}. + *

+ * Before the final view is rendered, the {@link UIViewRoot} will be marked transient in order to bypass the JSF state + * saving process. + * + * @author Jeremy Grelle + */ public class JsfRenderFinalResponseAction implements Action { ViewFactory viewFactory; diff --git a/spring-faces/src/main/java/org/springframework/faces/webflow/JsfView.java b/spring-faces/src/main/java/org/springframework/faces/webflow/JsfView.java index bd283e6a..d5c29645 100644 --- a/spring-faces/src/main/java/org/springframework/faces/webflow/JsfView.java +++ b/spring-faces/src/main/java/org/springframework/faces/webflow/JsfView.java @@ -1,3 +1,18 @@ +/* + * Copyright 2004-2007 the original author or authors. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ package org.springframework.faces.webflow; import java.io.IOException; @@ -14,6 +29,11 @@ import org.springframework.webflow.execution.Event; import org.springframework.webflow.execution.RequestContextHolder; import org.springframework.webflow.execution.View; +/** + * JSF-specific {@link View} implementation. + * + * @author Jeremy Grelle + */ public class JsfView implements View { public static final String EVENT_KEY = "org.springframework.webflow.FacesEvent"; @@ -58,6 +78,9 @@ public class JsfView implements View { return this.viewRoot; } + /** + * This implementation performs the standard duties of the JSF RENDER_RESPONSE phase. + */ public void render() { FacesContext facesContext = JsfFlowUtils.getFacesContext(facesLifecycle); facesContext.setViewRoot(viewRoot); diff --git a/spring-faces/src/main/java/org/springframework/faces/webflow/JsfViewFactory.java b/spring-faces/src/main/java/org/springframework/faces/webflow/JsfViewFactory.java index 6d98338b..2d165ed3 100644 --- a/spring-faces/src/main/java/org/springframework/faces/webflow/JsfViewFactory.java +++ b/spring-faces/src/main/java/org/springframework/faces/webflow/JsfViewFactory.java @@ -1,3 +1,18 @@ +/* + * Copyright 2004-2007 the original author or authors. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ package org.springframework.faces.webflow; import java.util.Iterator; @@ -16,6 +31,15 @@ import org.springframework.webflow.execution.RequestContext; import org.springframework.webflow.execution.View; import org.springframework.webflow.execution.ViewFactory; +/** + * JSF-specific {@link ViewFactory} implementation. + *

+ * This factory is responsible for performing the duties of the RESTORE_VIEW phase of the JSF lifecycle. If the current + * request is a post-back, then the rest of the standard JSF lifecyle through INVOKE_APPLICATION will be executed as + * well when an existing {@link JsfView} is found and restored. + * + * @author Jeremy Grelle + */ public class JsfViewFactory implements ViewFactory { private final Lifecycle facesLifecycle; diff --git a/spring-faces/src/main/java/org/springframework/faces/webflow/JsfViewFactoryCreator.java b/spring-faces/src/main/java/org/springframework/faces/webflow/JsfViewFactoryCreator.java index ef8a9779..964ff1a8 100644 --- a/spring-faces/src/main/java/org/springframework/faces/webflow/JsfViewFactoryCreator.java +++ b/spring-faces/src/main/java/org/springframework/faces/webflow/JsfViewFactoryCreator.java @@ -1,3 +1,18 @@ +/* + * Copyright 2004-2007 the original author or authors. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ package org.springframework.faces.webflow; import javax.faces.FactoryFinder; @@ -10,9 +25,9 @@ import org.springframework.webflow.execution.Action; import org.springframework.webflow.execution.ViewFactory; /** - * A ViewFactoryCreator implementation for creating JSF ViewFactories - * @author Jeremy Grelle + * A {@link ViewFactoryCreator} implementation for creating instances of a JSF-specific {@link ViewFactory}. * + * @author Jeremy Grelle */ public class JsfViewFactoryCreator implements ViewFactoryCreator {