[jira] [Commented] (MYFACES-3313) Calculation of redirect URL does not preserve the extension used in Faces Servlet mapping

2011-10-07 Thread Leonardo Uribe (Commented) (JIRA)

[ 
https://issues.apache.org/jira/browse/MYFACES-3313?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanelfocusedCommentId=13123039#comment-13123039
 ] 

Leonardo Uribe commented on MYFACES-3313:
-

I checked the spec finally I found this on section JSF 2.0 section 7.5.2 
Default ViewHandler Implementation:

... The getActionURL() method must fulfill the following responsibilities: ...
  If the argument viewId has an extension, and this extension is mapping, 
the result is contextPath + viewId. For example “/cardemo/chooseLocale.faces 
...

So the example proposed is on the spec. I agree use /page01.jsf is bad practice 
because the effective viewId when the view is created is /page01.xhtml . It is 
a long story, but at the end a change was introduced in JSF 2.1 to 
differentiate between physical and logical view ids 
(ViewHandler.deriveLogicalViewId). 

Anyway, since this is described on the spec we should fix our implementation of 
getActionURL() method.

 Calculation of redirect URL does not preserve the extension used in Faces 
 Servlet mapping
 -

 Key: MYFACES-3313
 URL: https://issues.apache.org/jira/browse/MYFACES-3313
 Project: MyFaces Core
  Issue Type: Bug
Affects Versions: 2.1.2, 2.1.3
Reporter: Deryk Sinotte

 I have a simple navigation test case that does a navigation between two 
 pages.  Both pages have the same simple markup:
   h:body
 h2Page 01/h2
 h:form
   h:commandButton id=navButton 
value=Nav
action=#{testBean.lastPage} /
 /h:form
   /h:body
 The backing bean methods simply return the appropriate action outcome:
 public String lastPage(){
 return lastPage;
 }
 And the faces-config file has the following navigation rules:
 navigation-rule
 from-view-id*/from-view-id
 navigation-case
 from-outcomelastPage/from-outcome
 to-view-id/page02.jsf/to-view-id
 redirect/
 /navigation-case
 navigation-case
 from-outcomefirstPage/from-outcome
 to-view-id/page01.jsf/to-view-id
 redirect/
 /navigation-case
 /navigation-rule
 The web.xml has a servlet mapping for .jsf files:
 servlet-mapping
 servlet-nameFaces Servlet/servlet-name
 url-pattern*.jsf/url-pattern
 /servlet-mapping
 If I go to the page01.jsf, the page loads fine.  When I click the Nav 
 button, the navigation occurs but the URL is page02.xhtml rather than 
 page02.jsf.  Because the extension is not preserved and there is no mapping 
 for .xhtml in this case, the page doesn't get handled by the Faces Servlet.  
 The current version of Mojarra (2.1.3) does preserve the extension when the 
 redirect URL is encoded.

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: 
https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira




[jira] [Commented] (MYFACES-3313) Calculation of redirect URL does not preserve the extension used in Faces Servlet mapping

2011-10-06 Thread Michael Kurz (Commented) (JIRA)

[ 
https://issues.apache.org/jira/browse/MYFACES-3313?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanelfocusedCommentId=13121891#comment-13121891
 ] 

Michael Kurz commented on MYFACES-3313:
---

I would say this is not a MyFaces bug. The problem here is, that you use 
/page01.jsf and /page02.jsf in to-view-id. But those values are NOT the view 
IDs of your views but the mapped url in the browser. The view IDs are 
/page01.xhtml and /page02.xhtml.

IMO, this issue can be closed as invalid.

 Calculation of redirect URL does not preserve the extension used in Faces 
 Servlet mapping
 -

 Key: MYFACES-3313
 URL: https://issues.apache.org/jira/browse/MYFACES-3313
 Project: MyFaces Core
  Issue Type: Bug
Affects Versions: 2.1.2, 2.1.3
Reporter: Deryk Sinotte

 I have a simple navigation test case that does a navigation between two 
 pages.  Both pages have the same simple markup:
   h:body
 h2Page 01/h2
 h:form
   h:commandButton id=navButton 
value=Nav
action=#{testBean.lastPage} /
 /h:form
   /h:body
 The backing bean methods simply return the appropriate action outcome:
 public String lastPage(){
 return lastPage;
 }
 And the faces-config file has the following navigation rules:
 navigation-rule
 from-view-id*/from-view-id
 navigation-case
 from-outcomelastPage/from-outcome
 to-view-id/page02.jsf/to-view-id
 redirect/
 /navigation-case
 navigation-case
 from-outcomefirstPage/from-outcome
 to-view-id/page01.jsf/to-view-id
 redirect/
 /navigation-case
 /navigation-rule
 The web.xml has a servlet mapping for .jsf files:
 servlet-mapping
 servlet-nameFaces Servlet/servlet-name
 url-pattern*.jsf/url-pattern
 /servlet-mapping
 If I go to the page01.jsf, the page loads fine.  When I click the Nav 
 button, the navigation occurs but the URL is page02.xhtml rather than 
 page02.jsf.  Because the extension is not preserved and there is no mapping 
 for .xhtml in this case, the page doesn't get handled by the Faces Servlet.  
 The current version of Mojarra (2.1.3) does preserve the extension when the 
 redirect URL is encoded.

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: 
https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira




[jira] [Commented] (MYFACES-3313) Calculation of redirect URL does not preserve the extension used in Faces Servlet mapping

2011-09-21 Thread Deryk Sinotte (JIRA)

[ 
https://issues.apache.org/jira/browse/MYFACES-3313?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanelfocusedCommentId=13109778#comment-13109778
 ] 

Deryk Sinotte commented on MYFACES-3313:


The issue is consistent when using partial page rendering as well.  The update 
that returns from:

MyFaces: ?xml version=1.0 encoding=utf-8?partial-responseredirect 
url=/my/page.xhtml/redirect/partial-response 

Mojarra: ?xml version='1.0' encoding='UTF-8'?partial-responseredirect 
url=/mo/page.jsf/redirect/partial-response

 Calculation of redirect URL does not preserve the extension used in Faces 
 Servlet mapping
 -

 Key: MYFACES-3313
 URL: https://issues.apache.org/jira/browse/MYFACES-3313
 Project: MyFaces Core
  Issue Type: Bug
Affects Versions: 2.1.2, 2.1.3
Reporter: Deryk Sinotte

 I have a simple navigation test case that does a navigation between two 
 pages.  Both pages have the same simple markup:
   h:body
 h2Page 01/h2
 h:form
   h:commandButton id=navButton 
value=Nav
action=#{testBean.lastPage} /
 /h:form
   /h:body
 The backing bean methods simply return the appropriate action outcome:
 public String lastPage(){
 return lastPage;
 }
 And the faces-config file has the following navigation rules:
 navigation-rule
 from-view-id*/from-view-id
 navigation-case
 from-outcomelastPage/from-outcome
 to-view-id/page02.jsf/to-view-id
 redirect/
 /navigation-case
 navigation-case
 from-outcomefirstPage/from-outcome
 to-view-id/page01.jsf/to-view-id
 redirect/
 /navigation-case
 /navigation-rule
 The web.xml has a servlet mapping for .jsf files:
 servlet-mapping
 servlet-nameFaces Servlet/servlet-name
 url-pattern*.jsf/url-pattern
 /servlet-mapping
 If I go to the page01.jsf, the page loads fine.  When I click the Nav 
 button, the navigation occurs but the URL is page02.xhtml rather than 
 page02.jsf.  Because the extension is not preserved and there is no mapping 
 for .xhtml in this case, the page doesn't get handled by the Faces Servlet.  
 The current version of Mojarra (2.1.3) does preserve the extension when the 
 redirect URL is encoded.

--
This message is automatically generated by JIRA.
For more information on JIRA, see: http://www.atlassian.com/software/jira