dev@javaserverfaces.java.net

Seeking review: change special string for redirect in implicit nav

From: Ed Burns <Ed.Burns_at_Sun.COM>
Date: Thu, 19 Feb 2009 10:29:46 -0800

Request:

>>>>> On Thu, 19 Feb 2009 11:39:59 +0000, Pete Muir <pmuir_at_REDHAT.COM> said:

PM> Sorry to reopen a closed issue, but Dan has raised the issue that some
PM> people may want to use the parameter redirect for other purposes, and
PM> so proposes calling it jsf-redirect or faces-redirect.

changebundle:

Issue: 419-implicit navigation


SECTION: Modified Files
----------------------------
M jsf-api/src/javax/faces/application/NavigationCase.java
M jsf-ri/src/com/sun/faces/application/NavigationHandlerImpl.java
M jsf-ri/systest-per-webapp/implicit-navigation/web/page03.xhtml
M jsf-demo/guessNumber2.0/web/greeting.xhtml

- Change the string that one must use to indicate a redirect during an
  implicit navigation to be "faces-redirect" instead of just "redirect".


SECTION: Diffs
----------------------------
Index: jsf-api/src/javax/faces/application/NavigationCase.java
===================================================================
--- jsf-api/src/javax/faces/application/NavigationCase.java (revision 6540)
+++ jsf-api/src/javax/faces/application/NavigationCase.java (working copy)
 -338,7 +338,7 @@
             sb.append(", fromOutcome='").append(fromOutcome).append('\'');
             sb.append(", if='").append(condition).append('\'');
             sb.append(", toViewId='").append(toViewId).append('\'');
- sb.append(", redirect=").append(redirect);
+ sb.append(", faces-redirect=").append(redirect);
             sb.append('}');
             toString = sb.toString();
         }
Index: jsf-ri/src/com/sun/faces/application/NavigationHandlerImpl.java
===================================================================
--- jsf-ri/src/com/sun/faces/application/NavigationHandlerImpl.java (revision 6540)
+++ jsf-ri/src/com/sun/faces/application/NavigationHandlerImpl.java (working copy)
 -91,7 +91,7 @@
      * Flag indicated the current mode.
      */
     private boolean development;
- private static final Pattern REDIRECT_EQUALS_TRUE = Pattern.compile("(?:\\?|&)(redirect=true(&|$))");
+ private static final Pattern REDIRECT_EQUALS_TRUE = Pattern.compile("(?:\\?|&)(faces-redirect=true(&|$))");
 
 
     // ------------------------------------------------------------ Constructors
Index: jsf-ri/systest-per-webapp/implicit-navigation/web/page03.xhtml
===================================================================
--- jsf-ri/systest-per-webapp/implicit-navigation/web/page03.xhtml (revision 6540)
+++ jsf-ri/systest-per-webapp/implicit-navigation/web/page03.xhtml (working copy)
 -13,7 +13,7 @@
 
     <p><h:commandButton value="page02" action="page02" /> [page03]
 
- <h:commandButton value="page04" action="page04?redirect=true" /></p>
+ <h:commandButton value="page04" action="page04?faces-redirect=true" /></p>
 
   </h:form>
     
Index: jsf-demo/guessNumber2.0/web/greeting.xhtml
===================================================================
--- jsf-demo/guessNumber2.0/web/greeting.xhtml (revision 6540)
+++ jsf-demo/guessNumber2.0/web/greeting.xhtml (working copy)
 -55,7 +55,7 @@
                           maximum="#{userNumberBean.maximum}"/>
             <f:convertNumber type="number" integerOnly="true"/>
         </h:inputText>
- <h:commandButton id="submit" action="response?redirect=true" value="Guess!"/>
+ <h:commandButton id="submit" action="response?faces-redirect=true" value="Guess!"/>
         <p/>
         <h:outputStylesheet name="css/styles.css"/>
         <h:message showSummary="true" showDetail="false"



-- 
| ed.burns_at_sun.com  | office: 408 884 9519 OR x31640
| homepage:         | http://ridingthecrest.com/