character of JSF managed bean error encoding page

My request is internationalized, and then I need special characters (accents of Spanish, copyright symbol,...). I test if I get the string to a managed bean that does not work.

JSF page:

<?xml version='1.0' encoding='UTF-8'?>
<!DOCTYPE html>
<f:view xmlns:f="http://java.sun.com/jsf/core" xmlns:af="http://xmlns.oracle.com/adf/faces/rich">
    <af:document title="Test" id="d1">        
        <af:form id="f1">        
          <af:panelGroupLayout id="pgl1">
            <af:outputText id="ot1" value="áéióúñ © it works" />
            <af:outputText id="ot2" value="#{myBean.text} it doesn't work" />
          </af:panelGroupLayout>
        </af:form>
    </af:document>
</f:view>

Bean

public Class MyBean {


  public MyBean() {
  }
  
  public String getText(){
    return "áéióúñ ©";
  }


}

I found this old post:

UTF-8 problem with ADF

But this solution is for the JSPX pages:

< jsp:directive.page contentType = text/html"; Charset = UTF - 8 "/ >

How can I solve this problem for ADF 12 c + JSF pages / Fragments of JSF Page. ?

It should work.

Check the compiler settings in the project properties (and also check: Tools-> preferences...-> environment)

Also check the encoding in the file pageDef (if you have one).

Dario

Tags: Java

Similar Questions

  • Access EJB session bean in JSF managed bean

    Components of the project: Weblogic 11 G + 12 c, 12 c EJB3 JPA 2 Jdeveloper-ADF

    I need to access EJB session bean in JSF managed bean and some methods of execution by program

    Work method and return EJB below
    Is this fair? Another way

    public static Object getEjbForDataControl (String name) {}
    BindingContainer DCBindingContainer = (DCBindingContainer) BindingContext.getCurrent () .getCurrentBindingsEntry ();
    DCDataControl cDataControl = bindingContainer.findDataControl (name);
    Return cDataControl.getDataProvider ();
    }

    Thank you

    Mohsen

    Hi Isabelle,.

    I assumed that his Session EJB bean has not been exposed as a data control (my bad, didn't read any of the discussion).

    Antonis

  • Attribute in JSF Managed Bean

    Hi all

    I have problem for assignment and to retrieve the value of an attribute in JSF Managed Bean.

    Scenario:

    public class jsf_managed_bean {}

    RichInputText it1.
    RichPopup p1.
    RichDialog d1;
    RichInputText it2.
    Number x;

    Methods getter and setter of all attributes

    public void setdialog (PopupFetchEvent e) {}
    the handle of the pop-up window
    this.setX (1);
    }

    {} public void getdialog (of DialogEvent)
    * if (this.getX () == 1) {*}
    Handle the event dialogue;
    }
    }

    }

    }


    When I access the variable in getDialog [DialogListener], I get NULL.

    You can access the instance of the component, because its get auto-câblé with its bean with all support requests incoming. To your string, simply change the methods so something like:

    public String getX()
    {
        return (String)getViewScope().get("x");
    }
    
    public void setX(String x)
    {
        getViewScope().put("x", x);
    }
    
    protected Map getViewScope()
    {
        return AdfFacesContext.getCurrentInstance().getViewScope();
    }
    

    Not too bad isn't?

    Kind regards

    ~ Simon

  • the managed bean error message display

    HIE

    on my page there are 3 data related to text entry boxes, and all are mandatory.

    There is a text box more input that is not bound to a data control.

    the button submit, I have a managed bean action method. In this action method I get the value of these data - not related to the input area and make a logic.
    From the I want to launch an error message on the UI for this component.

    How to do this?

    Vik
    http://adfjsf.blogspot.com
    http://Twitter.com/vikceo

    Hello

    You can do this using the FacesMessage class and this can be written anywhere within action/actionlistener/valuechangelistener/post etc...

    Example Code:

    //adding global message, which is displayed with af:messages tag
    FacesMessage msg = new FacesMessage(FacesMessage.SEVERITY_ERROR, null, "Value entered is invalid");
    context.addMessage(null, msg);  
    
    //Component level message, need to use af:message tag. This component level message is also displayed under af:messages tag unless globalOnly property is set to true
    msg = new FacesMessage(FacesMessage.SEVERITY_ERROR, null, "component level message - Value entered is invalid");
    context.addMessage(FacesContext.getCurrentInstance().getViewRoot().findComponent("
    

    Jean Lou

  • How to call a function with parameters in jsf managed Bean

    Hello

    1. I created a Bean managed to manage chains of jsf to 11.1.1.7 WebCenter spaces:

    public class ManageStrings {}

    / * Converts all characters in a string to uppercase. */

    public String getToUpperCase (String str) {}

    Dim retVal = str.toUpperCase ();

    Return retVal;

    }

    }

    2. I registered managed Bean:

    " < managed-bean id ="swc_3"xmlns =" http://xmlns.Oracle.com/ADF/controller "> "

    < id managed-bean-name = "swc_2" > tools < / managed-bean-name >

    < managed-bean-class id = "swc_1" > cat.badalona.webcenter.utilities.ManageStrings < / managed-bean-class >

    < managed-bean-scope id = "swc_4" > backingBean < / managed-bean-scope >

    < / managed-bean >

    3 to code jsf, I tried different options, but they do not work

    " < = xmlns:af af:outputText ' http://xmlns.Oracle.com/ADF/faces/rich "value="#{backingBeanScope.utilities.getToUpperCase['hello']}"/ > "

    ...

    " < = xmlns:af af:outputText ' http://xmlns.Oracle.com/ADF/faces/rich "value="#{backingBeanScope.utilities.toUpperCase['hello']}"/ > "

    ..

    " < = xmlns:af af:outputText ' http://xmlns.Oracle.com/ADF/faces/rich "value =" #{backingBeanScope.utilities.getToUpperCase ('hello')} "" / >


    What I am doing wrong?


    Thaks in advance


    Hello Carles,

    I did it with the content presenter where I need to pass the ID of the component selected in backing bean. Please try below option

    Now add following code in your binding

    Private RichOutputText outputText1;

    then the getter for this outputtext set.

    and in your action method to read the value of the output text.

    Hope this helps with your problem.

    Thank you

    Amey

  • JDeveloper 11 g managed bean &amp; resource bundle mysteries

    Hello

    I literally fight JDeveloper to make the location of my application. I want to set the locale of all my pages to a value of a managed bean (which gets the database for all users), so I put < f: view local = "#{Configuration.language}" > and get all the labels and strings in my UI to a resource group.

    Two issues were raised:

    1. I created a bean managed and recorded as 'Configuration' in faces-config. XML with scope. The managed bean is a private channel 'language' with accessors. When I use the "expression builder" on any page, it creates the following expression: "#{applicationScope.Configuration.language}". Unfortunately, it returns nothing. Manual change of the expression "#{Configuration.language}" finally returns! Why isn't he created like this by the generator expressions in the first place? I did sth. evil?

    2. I created a resource 'view.resources.UIresources' group and registered as "res" in faces - config.Xml. reference manually as #{res ['arbpl.titel ']} works fine. When the regional settings of the page are changed, strings are loaded from the appropriate resource bundle. As there is a lot of hits, I would use the wizard 'Select a resource text' or enter the values directly in the designer.

    However, the Assistant to "Select a text resource" refers to some crazy #{viewcontrollerBundle ['arbpl.titel']} and add "< c:set var ="viewcontrollerBundle"value="#{adfBundle['view.resources.UIresources']}"/ >" under the jsp:root. What is everything? The problem is that this way always the default resource group appears to be responsible no matter what locale are defined in the f: view.

    Who can help me see clear here?

    Thank you
    Matt

    Matt,

    Step 1 - really think you so that it is within reach of the session - if it is different for each user, it should be.

    In addition, on the generator, you are using the node called JSF managed Beans and navigate directly on your beans?

    John

  • The changing scope of the managed Bean to backingBean ask causes error

    Hello:

    With jdev 11.1.2 on windows xp sp2.

    I had an application to work with a scope of backingBean support bean. I made that one change... that is, changed the scope to request in the section of the managed Bean of adfc - config.Xml.
    After you make this change only, I get the following error on execution of the application. What I am doing wrong?

    Thanks for the help.



    Error 500 - Internal server error
    javax.el.PropertyNotFoundException: //C:/Documents and dsteger/Settings/Application Data/JDeveloper/system11.1.2.0.38.60.17/o.j2ee/drs/DD1/ViewControllerWebApp.war/page1.jsf @6,65 binding = "#{backingBeanScope.backing_page1.d1}": unattainable target, 'backing_page1' returned null "
    at com.sun.faces.facelets.el.TagValueExpression.setValue(TagValueExpression.java:133)
    at com.sun.faces.application.ApplicationImpl.createComponentApplyAnnotations(ApplicationImpl.java:1897)
    at com.sun.faces.application.ApplicationImpl.createComponent(ApplicationImpl.java:1109)
    at com.sun.faces.facelets.tag.jsf.ComponentTagHandlerDelegateImpl.createComponent(ComponentTagHandlerDelegateImpl.java:511)
    at com.sun.faces.facelets.tag.jsf.ComponentTagHandlerDelegateImpl.apply(ComponentTagHandlerDelegateImpl.java:157)
    at javax.faces.view.facelets.DelegatingMetaTagHandler.apply(DelegatingMetaTagHandler.java:120)
    at com.sun.faces.facelets.tag.jsf.core.ViewHandler.apply(ViewHandler.java:167)
    at com.sun.faces.facelets.compiler.NamespaceHandler.apply(NamespaceHandler.java:93)
    at javax.faces.view.facelets.CompositeFaceletHandler.apply(CompositeFaceletHandler.java:98)
    at com.sun.faces.facelets.compiler.EncodingHandler.apply(EncodingHandler.java:82)
    at com.sun.faces.facelets.impl.DefaultFacelet.apply(DefaultFacelet.java:152)
    at com.sun.faces.application.view.FaceletViewHandlingStrategy.buildView(FaceletViewHandlingStrategy.java:744)
    to org.apache.myfaces.trinidadinternal.application.ViewDeclarationLanguageFactoryImpl$ ChangeApplyingVDLWrapper.buildView (ViewDeclarationLanguageFactoryImpl.java:341)
    at oracle.adfinternal.view.faces.lifecycle.LifecycleImpl._renderResponse(LifecycleImpl.java:982)
    at oracle.adfinternal.view.faces.lifecycle.LifecycleImpl._executePhase(LifecycleImpl.java:334)
    at oracle.adfinternal.view.faces.lifecycle.LifecycleImpl.render(LifecycleImpl.java:232)
    at javax.faces.webapp.FacesServlet.service(FacesServlet.java:313)
    to weblogic.servlet.internal.StubSecurityHelper$ ServletServiceAction.run (StubSecurityHelper.java:227)
    at weblogic.servlet.internal.StubSecurityHelper.invokeServlet(StubSecurityHelper.java:125)
    at weblogic.servlet.internal.ServletStubImpl.execute(ServletStubImpl.java:300)
    at weblogic.servlet.internal.TailFilter.doFilter(TailFilter.java:26)
    at weblogic.servlet.internal.FilterChainImpl.doFilter(FilterChainImpl.java:56)
    at oracle.adf.model.servlet.ADFBindingFilter.doFilter(ADFBindingFilter.java:173)
    at weblogic.servlet.internal.FilterChainImpl.doFilter(FilterChainImpl.java:56)
    at oracle.adfinternal.view.faces.webapp.rich.RegistrationFilter.doFilter(RegistrationFilter.java:121)
    to org.apache.myfaces.trinidadinternal.webapp.TrinidadFilterImpl$ FilterListChain.doFilter (TrinidadFilterImpl.java:468)
    at oracle.adfinternal.view.faces.activedata.AdsFilter.doFilter(AdsFilter.java:60)
    to org.apache.myfaces.trinidadinternal.webapp.TrinidadFilterImpl$ FilterListChain.doFilter (TrinidadFilterImpl.java:468)
    at org.apache.myfaces.trinidadinternal.webapp.TrinidadFilterImpl._doFilterImpl(TrinidadFilterImpl.java:293)
    at org.apache.myfaces.trinidadinternal.webapp.TrinidadFilterImpl.doFilter(TrinidadFilterImpl.java:199)
    at org.apache.myfaces.trinidad.webapp.TrinidadFilter.doFilter(TrinidadFilter.java:92)
    at weblogic.servlet.internal.FilterChainImpl.doFilter(FilterChainImpl.java:56)
    to oracle.security.jps.ee.http.JpsAbsFilter$ 1.run(JpsAbsFilter.java:111)
    at java.security.AccessController.doPrivileged (Native Method)
    at oracle.security.jps.util.JpsSubject.doAsPrivileged(JpsSubject.java:313)
    at oracle.security.jps.ee.util.JpsPlatformUtil.runJaasMode(JpsPlatformUtil.java:413)
    at oracle.security.jps.ee.http.JpsAbsFilter.runJaasMode(JpsAbsFilter.java:94)
    at oracle.security.jps.ee.http.JpsAbsFilter.doFilter(JpsAbsFilter.java:161)
    at oracle.security.jps.ee.http.JpsFilter.doFilter(JpsFilter.java:71)
    at weblogic.servlet.internal.FilterChainImpl.doFilter(FilterChainImpl.java:56)
    at oracle.dms.servlet.DMSServletFilter.doFilter(DMSServletFilter.java:136)
    at weblogic.servlet.internal.FilterChainImpl.doFilter(FilterChainImpl.java:56)
    at weblogic.servlet.internal.RequestEventsFilter.doFilter(RequestEventsFilter.java:27)
    at weblogic.servlet.internal.FilterChainImpl.doFilter(FilterChainImpl.java:56)
    to weblogic.servlet.internal.WebAppServletContext$ ServletInvocationAction.wrapRun (WebAppServletContext.java:3715)
    to weblogic.servlet.internal.WebAppServletContext$ ServletInvocationAction.run (WebAppServletContext.java:3681)
    at weblogic.security.acl.internal.AuthenticatedSubject.doAs(AuthenticatedSubject.java:321)
    at weblogic.security.service.SecurityManager.runAs(SecurityManager.java:120)
    at weblogic.servlet.internal.WebAppServletContext.securedExecute(WebAppServletContext.java:2277)
    at weblogic.servlet.internal.WebAppServletContext.execute(WebAppServletContext.java:2183)
    at weblogic.servlet.internal.ServletRequestImpl.run(ServletRequestImpl.java:1454)
    at weblogic.work.ExecuteThread.execute(ExecuteThread.java:209)
    at weblogic.work.ExecuteThread.run(ExecuteThread.java:178)

    If you change the extent of the scope of the request, then, the value should be like

    #{backing_page1.d1}

    If its scope of the bean to support, then it will be

    #{backingBeanScope.backing_page1.d1}

    If the scope of the page flow, then it will be

    #{pageFlownScope.backing_page1.d1}

    guess you got it now...

  • Managed bean doesn't have this property error

    Hello

    I want to show the Group of radio buttons on my page. The values I put in my managed bean method that returns a list.

    I took a selected component of radio one and he chose my method that returns a list.

    But when I run the page it gives error that the class does not have the property.

    Here is the code that I wrote in the method which returns the list:

    Please let me know what is the problem here. Thank you

    public list choiceList() {}

    System.out.println ("inside the bean');

    DCBindingContainer links =

    (DCBindingContainer) BindingContext.getCurrent () .getCurrentBindingsEntry ();

    DCIteratorBinding iter =

    bindings.findIteratorBinding ("TblSurveyQuestionsView1Iterator");

    ViewObject vo = iter.getViewObject ();

    String rowAnswer =

    vo.getCurrentRow ().getAttribute("RowAnswerChoice").toString ();

    ("String [] answers = rowAnswer.split("\\n ");

    System.out.println (response [0] + "navneet" + answers [1]);

    The list of answersList = Arrays.asList (answers);

    Return answersList;

    Rename the method to be getChoiceList() and write another one, with the name setChoiceList(List value) {...}

  • Need help for managed bean - to the values of the extraction of data loading of jsf is

    Hello
    in the construction of managed bean, I wrote code to extract values from database.

    but for each action (such as button clicks, drop-down list changes etc...) this constructor is called I don't want.

    I tried to over come this using beforePhase event of the jsf. but sometimes it doesn't property.

    Someone please help me to retrieve the values of data base loading of jsf is.

    Thank you
    Veera

    Veera
    If you want to execute a method in a method beforePhase only once (when loading the page) then you can check the expression #{adfFacesContext.initialRender} before running all you want.

    import javax.el.ELContext;
    import javax.el.ExpressionFactory;
    import javax.el.ValueExpression;
    import javax.faces.application.Application;
    import javax.faces.context.FacesContext;
    import javax.faces.event.PhaseEvent;
    
    public class Test {
    
        public boolean isInitialrender() {
            FacesContext fctx = FacesContext.getCurrentInstance();
            Application application = fctx.getApplication();
            ExpressionFactory expressionFactory =
                application.getExpressionFactory();
            ELContext context = fctx.getELContext();
            ValueExpression createValueExpression =
                expressionFactory.createValueExpression(context,
                                                        "#{adfFacesContext.initialRender}",
                                                        Object.class);
            Boolean isInitialrender =
                (Boolean)createValueExpression.getValue(context);
            return isInitialrender;
    
        }
    
        public void beforePhaseMethod(PhaseEvent phaseEvent) {
            // Add event code here...
            if (isInitialrender()) {
                System.out.println("This statement is shown once... when the page is loaded");
            }
        }
    }
    
  • Error by calling the method on Bean managed from an other managed Bean

    Hello

    (Jdev 11.1.1.2.0)

    Help please:

    I have a managed bean (page scope of stream) that is used by my homepage for navigation of flow dynamic region:

    * / public class RegionNavigationBean implements Serializable {* +}
    private String dynamicTaskFlowId = "/ WEB-INF/home-task-flow-definition.xml#home-task-flow-definition"; +

    * public RegionNavigationBean() {* +}
    *}*

    * public TaskFlowId getDynamicTaskFlowId() {* +}
    Return TaskFlowId.parse (dynamicTaskFlowId); +
    *}*

    * public void setDynamicTaskFlowId (String taskFlowId) {* +}
    this.dynamicTaskFlowId = taskFlowId; +
    *}*
    *}*

    taskFlowId is set to the homepage def to + * ${pageFlowScope.regionNavigationBean.dynamicTaskFlowId} * +.

    In a table (i.e. display on my model layer object) DB I store a menu ID and a corresponding task_flow_id.

    Then I created a class of earphone action (RegionNavigationListener - scope of stream page) which I link to my menu on my main page items (property listener action on the item of menu = + * #{pageFlowScope.regionNavigationAction.processAction} * +)

    In this action (processAction method) listening port, I retrieve rowset in the VO menu and find the record that matches my menu ID that triggered the action event, recovering the task_flow_id that needs to be accessed.

    I then try to retrieve the instance of the RegionNavigationBean with the following statement: RegionNavigationBean regNav = (RegionNavigationBean) JSFUtils.getManagedBeanValue ("regionNavigationBean"); +.
    It seems to work fine, but as soon as I try to use it I get a NullPointerException error, for example:
    regNav.setDynamicTaskFlowId (menusRow.gettaskFlowId ()); +
    or:
    System.out.println ("%" + regNav.toString ()); +

    This is quite new to me... any help would be appreciated!

    Thank you
    Mario

    Hi Mario,.

    I tried following codes to get a bean managed in a region, it is very good for me.
    ManagedBean is the name of the class.

    FacesContext ctx = FacesContext.getCurrentInstance ();
    Application app = ctx.getApplication ();
    ManagedBean MB = (ManagedBean) app.evaluateExpressionGet (ctx, "#{pageFlowScope.managedBeanName}", ManagedBean.class);

    Todd

  • Access a managed bean of a region on a page

    Hi Experts,

    I have a parentTF.xml of flow of tasks parent that contains a page, parentPage.jsff and I have an area of childTF.xml.

    childTF.xml has a managed bean, childBean.java and parentTF a parentBean.java.

    I want to go to the parentBean.java chilBean method. Is this possible?

    Re: Access to a taskflow bean managed via code

    Let me know if you need assistance...

  • call method before managed Bean support page

    Hi guys,.

    My Version of Jdev is 12 c. I want to call a method of bean managed before my Page load. I did an EnableDisableMethod() method in my managed Bean that is my default activity in my taskflow. This method is only how to turn off to some of my Page buttons. I use * in my control flow so that my page will be called each time after the execution of my method by default. But what my result will be fixed for my activity method. Also what is the use of the result sets.

    <-l' id = 'enableDisable' method call >

    < method > #{pageFlowScope.bgBean.enableDisable} < / method >

    < result >

    < / results >

    < / method >

    Also when I run that application.page is empty but in newspaper that comes

    < 23 June 2014 12:41:30 IST > < WARNING > < oracle.adfinternal.controller.metadata.model.xml.PageFlowXmlImpl > < BEA-000000 > < ADFc: /WEB-INF/bGMstTF.xml #bGMstTF: >

    < 23 June 2014 12:41:30 IST > < WARNING > < oracle.adfinternal.controller.metadata.model.xml.PageFlowXmlImpl > < ADFC-52024 > < ADFc: duplicate managed definition of bean to "bgBean" detected. >

    < 23 June 2014 12:41:30 IST > < WARNING > < oracle.adfinternal.controller.activity.MethodCallActivityLogic > < ADFC-56013 > < ADFc: Exception when the assessment call to method activity expression EL "#{pageFlowScope.bgBean.enableDisable}". >

    When I'm debugging its my default front method call load.but page does not redirect to my page. I think that the problem with my key component.before page load it does not know my button

    mainBtnAdd.setDisabled (true);  It is here, I think what he does ' t know button until pageLoad.mainBtnAdd is null in debug mode.

    Thank you

    Raul

    Oh and Yes your button is known that once the page is rendered. To solve your problem you add to the bean (Boolean or string) which then reference you via el of the property of button on the properties page. In method you you set just the properties of the bean.

    Timo

  • Several fragments of the page pointing to the same managed bean

    Hi all

    Jdev version 11.1.1.7.1

    I wanted to know if we can point to several jsff developed o your managed bean?

    While I'm trying to do, I don't get the option to create a new property or use an existing property of the bean while creating a link.

    Is this possible, if so what should be the scope of these beans.

    Hi Ashish,

    The field itself has been disabled for me, what I did was save the bean in the scope of the Session in the config of the adfc. Now its working fine for me.

  • Managed bean does not

    Dear experts,

    IM using JDeveloper 11.1.2.2.0
    I created managed bean for the command button issue in my jsf page.
    It is the MB code:
    ---------------------------------------------------
    package common.model.view;

    Import javax.faces.event.ActionEvent;

    public class abc {}
    public abc() {}
    }

    {} public void getSelectedRow (ActionEvent actionEvent)
    Add the code in the event here...
    System.out.println ("testing...");
    }
    }

    -------------------------------------------------
    But after the execution of the web page, it displays following error when you click the command button.
    Pls advice me to solve this problem.
    Thank you

    Mauricette

    **********************************



    < MethodExpressionActionListener > < processAction > received 'javax.el.PropertyNotFoundException' when calling action listener "#{xxxxxxxx.yyyyyyy}" for the component "cb1".
    < MethodExpressionActionListener > < processAction > javax.el.PropertyNotFoundException: //C:/Users/charithk/AppData/Roaming/JDeveloper/system11.1.2.2.39.61.83.1/o.j2ee/drs/LifePolicy/LifePolicyViewCntWebApp.war/LifePolicyPage.jsf @75,117 actionListener = "#{xxxxxxxx.yyyyyyy}": unattainable target, resolved to null "xxxxxxxx" identifier "
    at com.sun.faces.facelets.el.TagMethodExpression.invoke(TagMethodExpression.java:107)
    at javax.faces.event.MethodExpressionActionListener.processAction(MethodExpressionActionListener.java:148)
    at javax.faces.event.ActionEvent.processListener(ActionEvent.java:88)
    at org.apache.myfaces.trinidad.component.UIXComponentBase.broadcast(UIXComponentBase.java:824)
    at org.apache.myfaces.trinidad.component.UIXCommand.broadcast(UIXCommand.java:179)
    to oracle.adf.view.rich.component.fragment.ContextSwitchingComponent$ 1.run(ContextSwitchingComponent.java:130)
    at oracle.adf.view.rich.component.fragment.ContextSwitchingComponent._processPhase(ContextSwitchingComponent.java:461)
    at oracle.adf.view.rich.component.fragment.ContextSwitchingComponent.broadcast(ContextSwitchingComponent.java:134)
    at oracle.adf.view.rich.component.fragment.UIXInclude.broadcast(UIXInclude.java:112)
    to oracle.adf.view.rich.component.fragment.ContextSwitchingComponent$ 1.run(ContextSwitchingComponent.java:130)
    at oracle.adf.view.rich.component.fragment.ContextSwitchingComponent._processPhase(ContextSwitchingComponent.java:461)
    at oracle.adf.view.rich.component.fragment.ContextSwitchingComponent.broadcast(ContextSwitchingComponent.java:134)
    at oracle.adf.view.rich.component.fragment.UIXInclude.broadcast(UIXInclude.java:106)
    at javax.faces.component.UIViewRoot.broadcastEvents(UIViewRoot.java:787)
    at javax.faces.component.UIViewRoot.processApplication(UIViewRoot.java:1252)
    at oracle.adfinternal.view.faces.lifecycle.LifecycleImpl._invokeApplication(LifecycleImpl.java:970)
    at oracle.adfinternal.view.faces.lifecycle.LifecycleImpl._executePhase(LifecycleImpl.java:351)
    at oracle.adfinternal.view.faces.lifecycle.LifecycleImpl.execute(LifecycleImpl.java:207)
    at javax.faces.webapp.FacesServlet.service(FacesServlet.java:508)
    to weblogic.servlet.internal.StubSecurityHelper$ ServletServiceAction.run (StubSecurityHelper.java:227)
    at weblogic.servlet.internal.StubSecurityHelper.invokeServlet(StubSecurityHelper.java:125)
    at weblogic.servlet.internal.ServletStubImpl.execute(ServletStubImpl.java:300)
    at weblogic.servlet.internal.TailFilter.doFilter(TailFilter.java:26)
    at weblogic.servlet.internal.FilterChainImpl.doFilter(FilterChainImpl.java:56)
    at oracle.adf.model.servlet.ADFBindingFilter.doFilter(ADFBindingFilter.java:173)
    at weblogic.servlet.internal.FilterChainImpl.doFilter(FilterChainImpl.java:56)
    at oracle.adfinternal.view.faces.webapp.rich.RegistrationFilter.doFilter(RegistrationFilter.java:125)
    to org.apache.myfaces.trinidadinternal.webapp.TrinidadFilterImpl$ FilterListChain.doFilter (TrinidadFilterImpl.java:468)
    at oracle.adfinternal.view.faces.activedata.AdsFilter.doFilter(AdsFilter.java:60)
    to org.apache.myfaces.trinidadinternal.webapp.TrinidadFilterImpl$ FilterListChain.doFilter (TrinidadFilterImpl.java:468)
    at org.apache.myfaces.trinidadinternal.webapp.TrinidadFilterImpl._doFilterImpl(TrinidadFilterImpl.java:293)
    at org.apache.myfaces.trinidadinternal.webapp.TrinidadFilterImpl.doFilter(TrinidadFilterImpl.java:199)
    at org.apache.myfaces.trinidad.webapp.TrinidadFilter.doFilter(TrinidadFilter.java:92)
    at weblogic.servlet.internal.FilterChainImpl.doFilter(FilterChainImpl.java:56)
    at oracle.adf.library.webapp.LibraryFilter.doFilter(LibraryFilter.java:180)
    at weblogic.servlet.internal.FilterChainImpl.doFilter(FilterChainImpl.java:56)
    to oracle.security.jps.ee.http.JpsAbsFilter$ 1.run(JpsAbsFilter.java:119)
    at java.security.AccessController.doPrivileged (Native Method)
    at oracle.security.jps.util.JpsSubject.doAsPrivileged(JpsSubject.java:315)
    at oracle.security.jps.ee.util.JpsPlatformUtil.runJaasMode(JpsPlatformUtil.java:442)
    at oracle.security.jps.ee.http.JpsAbsFilter.runJaasMode(JpsAbsFilter.java:103)
    at oracle.security.jps.ee.http.JpsAbsFilter.doFilter(JpsAbsFilter.java:171)
    at oracle.security.jps.ee.http.JpsFilter.doFilter(JpsFilter.java:71)
    at weblogic.servlet.internal.FilterChainImpl.doFilter(FilterChainImpl.java:56)
    at oracle.dms.servlet.DMSServletFilter.doFilter(DMSServletFilter.java:139)
    at weblogic.servlet.internal.FilterChainImpl.doFilter(FilterChainImpl.java:56)
    at weblogic.servlet.internal.RequestEventsFilter.doFilter(RequestEventsFilter.java:27)
    at weblogic.servlet.internal.FilterChainImpl.doFilter(FilterChainImpl.java:56)
    to weblogic.servlet.internal.WebAppServletContext$ ServletInvocationAction.wrapRun (WebAppServletContext.java:3715)
    to weblogic.servlet.internal.WebAppServletContext$ ServletInvocationAction.run (WebAppServletContext.java:3681)
    at weblogic.security.acl.internal.AuthenticatedSubject.doAs(AuthenticatedSubject.java:321)
    at weblogic.security.service.SecurityManager.runAs(SecurityManager.java:120)
    at weblogic.servlet.internal.WebAppServletContext.securedExecute(WebAppServletContext.java:2277)
    at weblogic.servlet.internal.WebAppServletContext.execute(WebAppServletContext.java:2183)
    at weblogic.servlet.internal.ServletRequestImpl.run(ServletRequestImpl.java:1454)
    at weblogic.work.ExecuteThread.execute(ExecuteThread.java:209)
    at weblogic.work.ExecuteThread.run(ExecuteThread.java:178)

    It seems that the bean was not found. You set in your config adfc. XML or a btf config? Make sure the names of the bean defined in one of the old config files match. Otherwise, check the exact scope of the bean.

  • Generate PDFS using Managed Bean with custom HTTP headers

    Background
    Generate a report in various formats (PDF, delimited, Excel, HTML, etc.) using JDeveloper 11 g Release 2 (11.1.2.3.0) when you click on an af:commandButton. See also the version StackOverflow about this issue:

    http://StackOverflow.com/q/13654625/59087

    Problem
    The HTTP headers are sent twice: once by the framework and once by a bean.

    Source code
    The source code includes:

    -Action button
    -Managed Bean
    -Task flow

    Action button
    The action of the button:

    < af:commandButton text = 'Report' id = 'submitReport' action = "Execute" / >

    Managed bean
    The managed Bean is relatively complex. The code "responseComplete" get called, however, it does not seem to be called early enough to avoid the framework application writes the HTTP headers.

    Substitution of HTTP response header

    /**
    * Defines the HTTP headers must indicate to the browser that the
    * the report must be downloaded (not displayed in the current
    * window).
    */
    protected void setDownloadHeaders() {}
    HttpServletResponse response = getServletResponse();
    response.setHeader ("Content-Description", getContentDescription());
    response.setHeader ("Content-Disposition", 'attachment filename ='
    (+ getFilename());
    response.setHeader ("Content-Type", getContentType());
    response.setHeader ("Content-Transfer-Encoding',
    getContentTransferEncoding());
    }

    Question answer full
    The bean indirectly says infrastructure that the answer is managed (by the bean):

    getFacesContext () .responseComplete ();

    Bean, run and configure

    public void run() {}
    try {}
    Report = getReport();
    Configures (Report.GetParameters ());
    Report.Run ();
    } catch (Exception e) {}
    e.printStackTrace ();
    }
    }

    private void configuration (parameters p) {}
    p.put (ReportImpl.SYSTEM_REPORT_PROTOCOL, "http");
    p.put (ReportImpl.SYSTEM_REPORT_HOST, "localhost");
    p.put (ReportImpl.SYSTEM_REPORT_PORT, "7002");
    p.put (ReportImpl.SYSTEM_REPORT_PATH, "/ reports/rwservlet" "");
    p.put (Parameters.PARAM_REPORT_FORMAT, 'pdf');

    p.put ("report_cmdkey", getReportName());
    p.put ("report_ORACLE_1", getReportDestinationType());
    p.put ("report_ORACLE_2", getReportDestinationFormat());
    }

    Workflow
    The workflow calls Execute, which refers to the 'run()' of the bean method:

    entry-> Home-> run-> ReportBeanRun

    Where:

    <-l' call the method id = "ReportBeanRun" >
    < description > running a report < / description >
    Report to run < display name > < / display-name >
    < method > #{reportBean.run} < / method >
    < result >
    success of < fixed-result > < / fixed-results >
    < / results >
    < / method >

    The bean is assigned to the scope of the "demand", with a few managed properties:

    < rule of flow control = "__3" id >
    hand < of-activity-id > < /-activity-id >
    < control-flow-case id = "ExecuteReport" >
    run < from outcome > < / de-results >
    ReportBeanRun < to-activity-id > < / to-activity-id >
    < / control-flow-case >
    < / control-flow-rule >

    < managed-bean id = "ReportBean" >
    < description > running a report < / description >
    < display name > ReportBean < / display-name >
    application of < managed-bean-scope > < / managed-bean-scope >
    ...
    < / managed-bean >

    The "success < fixed-result > < / fixed-result > ' strikes me as wrong - I don't want to not the method call to return to another task."

    Restrictions
    The report server receives requests from the web server only. The URL of the report server cannot use browsers to download directly, for security reasons.

    Error messages
    The error message is generated:
    Duplicate received headers from the server

    349 (net::ERR_RESPONSE_HEADERS_MULTIPLE_CONTENT_DISPOSITION) error: multiple headers received separate Content-Disposition. It is not allowed to protect themselves against HTTP response splitting attacks. Nevertheless, the report is generated. Prevents the framework to write headers HTTP would solve this problem.

    Question
    How can define you HTTP headers in ADF using a workflow to generate a PDF file by calling a managed bean?

    Ideas

    Some additional ideas:

    -Substitute the listener of the Phase of the lifecycle of Page ("ADFPhaseListener" + "PageLifecycle")
    -Develop a customized web server Servlet

    Related links
    -http://www.oracle.com/technetwork/middleware/bi-publisher/adf-bip-ucm-integration-179699.pdf
    -http://www.slideshare.net/lucbors/reports-no-notes#btnNext
    -http://www.techartifact.com/blogs/2012/03/calling-oracle-report-from-adf-applications.html?goback=%2Egde_4212375_member_102062735
    -http://docs.oracle.com/cd/E29049_01/web.1112/e16182/adf_lifecycle.htm#CIABEJFB

    Thank you!

    The problem was that the HTTP headers have been actually written twice:

    1. the report server returns the HTTP response headers.
    2. the bean was his own (as mentioned in the question) HTTP response headers.
    3. the bean was copy all the contents of the report server response, including headers, to the output stream.

    Firefox has ignored the header in double, but not Google Chrome errors.

Maybe you are looking for