Cannot reset buffer after response has been committed JspViewDeclarationLanguageStrategy

2012-07-25 Thread Thomas Andraschko
Hi,

i get following error if i try to open a page, which does not exist:
Cannot reset buffer after response has been committed

As far as i can see, the JspViewDeclarationLanguageStrategy handles the
null viewId and if i return false in #isHandle, it works without
problems.
Why JspViewDeclarationLanguageStrategy handles also the null viewId?

I looked at the code and org.apache.myfaces.SUPPORT_JSP_AND_FACES_EL should
disable the JspViewDeclarationLanguageStrategy, right?
If i set this context param to false, i get follwing exception on startup:
An error occured while initializing MyFaces: No javax.el.ExpressionFactory
found. Please provide context-param in web.xml:
org.apache.myfaces.EXPRESSION_FACTORY

Why is it required to manually set the ExpressionFactory? We use Jetty on
localhost and JUEL/Tomcat on our servers.

Thanks!
Thomas


Re: Cannot reset buffer after response has been committed JspViewDeclarationLanguageStrategy

2012-07-25 Thread Thomas Andraschko
Ah, sorry! I got another exception now:

javax.faces.FacesException: Cannot find a valid PDL for view id null.

So the third question is, isn't there any viewId == null check?

2012/7/25 Thomas Andraschko zoi...@googlemail.com

 Hi,

 i get following error if i try to open a page, which does not exist:
 Cannot reset buffer after response has been committed

 As far as i can see, the JspViewDeclarationLanguageStrategy handles the
 null viewId and if i return false in #isHandle, it works without
 problems.
 Why JspViewDeclarationLanguageStrategy handles also the null viewId?

 I looked at the code and org.apache.myfaces.SUPPORT_JSP_AND_FACES_EL
 should disable the JspViewDeclarationLanguageStrategy, right?
 If i set this context param to false, i get follwing exception on startup:
 An error occured while initializing MyFaces: No javax.el.ExpressionFactory
 found. Please provide context-param in web.xml:
 org.apache.myfaces.EXPRESSION_FACTORY

 Why is it required to manually set the ExpressionFactory? We use Jetty on
 localhost and JUEL/Tomcat on our servers.

 Thanks!
 Thomas






Re: Cannot reset buffer after response has been committed JspViewDeclarationLanguageStrategy

2012-07-25 Thread Thomas Andraschko
I created an issue after analzing the original problem:
https://issues.apache.org/jira/browse/MYFACES-3587

Should i also create an issue because disable SUPPORT_JSP_AND_FACES_EL
requires to set the EXPRESSION_FACTORY? Or is it be design?

2012/7/25 Thomas Andraschko zoi...@googlemail.com

 Ah, sorry! I got another exception now:

 javax.faces.FacesException: Cannot find a valid PDL for view id null.

 So the third question is, isn't there any viewId == null check?


 2012/7/25 Thomas Andraschko zoi...@googlemail.com

 Hi,

 i get following error if i try to open a page, which does not exist:
 Cannot reset buffer after response has been committed

 As far as i can see, the JspViewDeclarationLanguageStrategy handles the
 null viewId and if i return false in #isHandle, it works without
 problems.
 Why JspViewDeclarationLanguageStrategy handles also the null viewId?

 I looked at the code and org.apache.myfaces.SUPPORT_JSP_AND_FACES_EL
 should disable the JspViewDeclarationLanguageStrategy, right?
 If i set this context param to false, i get follwing exception on startup:
 An error occured while initializing MyFaces: No
 javax.el.ExpressionFactory found. Please provide context-param in
 web.xml: org.apache.myfaces.EXPRESSION_FACTORY

 Why is it required to manually set the ExpressionFactory? We use Jetty on
 localhost and JUEL/Tomcat on our servers.

 Thanks!
 Thomas







JSF Facescomponent change reference value

2012-07-25 Thread José Luis Cetina
I pass a string reference to my composite component with the value =
ORIGINAL VALUE, then my composite component have a button, this button
change the original value to = HERE IM SETTING A NEW VALUE, then when
i press my button in my normal page: page.xhtml for review it,the
value still without any change (ORIGINAL VALUE), why this happend, if
my string is pass as a reference because is an object, what im doing
wrong?

Resume:

1. I pass a String (as attribute to my composite component) with the
value: ORIGINAL VALUE
2. Then in the composite component i get this attribute and change it
to =HERE IM SETTING A NEW VALUE
3. When i review the value in page.xhtml i see again ORIGINAL VALUE
(not expected)
4. If i review my value in my composite component i have:HERE IM
SETTING A NEW VALUE

I try to set my Bean to RequestScoped, ViewAccessScoped and
SessionScoped and the problem is the same.

Here is an example:

My composite component: myComponent.xhtml

 ui:component  xmlns=http://www.w3.org/1999/xhtml;
  xmlns:p=http://primefaces.org/ui;
  xmlns:cc=http://java.sun.com/jsf/composite;
  xmlns:ui=http://java.sun.com/jsf/facelets;
  xmlns:h=http://java.sun.com/jsf/html;

cc:interface componentType=myComponent
cc:attribute name=myString type=java.lang.String/
/cc:interface

cc:implementation
p:commandButton value=Change Value
 actionListener=#{cc.changeStringValue}/
/cc:implementation

/ui:component
My FacesComponent Class:

@FacesComponent(value=myComponent)
 public class MyComponent extends UINamingContainer  {
   public void changeStringValue(ActionEvent e){
 String originalValue = (String) getAttributes().get(myString);
 //Here i change the value
 originalValue = HERE IM SETTING A NEW VALUE;
   }
 }
My page.xhtml

h:body
 h:form id=myform
 test:myComponent myString=#{myBean.myString}/
 p:commandButton value=Review change
 actionListener=#{myBean.showValue}/
h/form
/h:body
ManagedBean:

@Named
@ViewAccessScoped
public void MyBean implements Serializable{
   public String myString = ORIGINAL VALUE;

   public void showValue(ActionEvent e){
//why here i see ORIGINAL VALUE if my component change the reference value??
 System.out.println(Value: +myString);
   }

  //setters and getters...
}



What im doing wrong???