ADF access binding context in Servlet

Hello. I'm trying to use a Servlet to present some XML in a framework that is inserted on the JSF page. The inlineFrame takes its Source from the URL of the servlet. I use JDeveloper 11.1.2.1.0.

The XML is stored on the database, so I will try to get it back in the Servlet (based on a parameter value). However, I get a Null pointer Exception in the Servlet because nothing is returned in the BindingContext - no containers or controls data.

I looked at different blogs, messages etc. which suggest methods to do so. So far, I have:
-set up the Servlet in the web.xml file, as follows:
  <servlet>
    <servlet-name>ShowXMLServlet</servlet-name>
    <servlet-class>view.ShowXMLServlet</servlet-class>
  </servlet>
  <servlet-mapping>
    <servlet-name>ShowXMLServlet</servlet-name>
    <url-pattern>/showxmlservlet</url-pattern>
  </servlet-mapping>
  <filter>
    <filter-name>adfBindings</filter-name>
    <filter-class>oracle.adf.model.servlet.ADFBindingFilter</filter-class>
  </filter>
  <filter-mapping>
    <filter-name>adfBindings</filter-name>
    <servlet-name>ShowXMLServlet</servlet-name>
    <dispatcher>FORWARD</dispatcher>
    <dispatcher>REQUEST</dispatcher>
  </filter-mapping>
-the Servlet is also added to the DataBindings.cpx file as follows:
 <pageMap>
    <page path="/showxmlservlet" usageId="view_view_dummyPageDef1" />
    <page path="/view_dummy.jsf" usageId="view_view_dummyPageDef1"/>
  </pageMap>
  <pageDefinitionUsages>
    <page id="view_view_dummyPageDef1" path="view.pageDefs.view_dummyPageDef1"/>
 </pageDefinitionUsages>
- and of course, I created the dummy PageDef (view_dummyPageDef1.xml), which currently has a single binding.

-C' is the extract of Servlet code that attempts to access the binding context. This causes Null pointer exception, but the dcBindingContainer is null.
        BindingContext bindingContext=null;
        bindingContext = BindingContext.getCurrent();
        DCBindingContainer dcBindingContainer =         bindingContext.findBindingContainer("view_dummyPageDef1");
I tried also access to liaison with reference to the active DataControlFrame at the point the Servlet is called and stored in a session variable. But this was not either - same result.

I missed a simple step here? Thanks for your help.

I'm not in front of my vo to check your code, but you can check out my blog on the file and image manipulation. Part 3 (http://wp.me/pcBZk-bU) had a sample servlet access to the link.

Timo

Tags: Java

Similar Questions

  • difference between the binding context and link container

    Hello experts

    can you please explain to me the difference between the binding context and link container.

    I searched on the net but unable to understand the concept.

    Hello

    the BindingContext represents the DataBindings.cpx file execution and is a record of BindingContainers and their mapping pages and views. In addition it contains information about the data used by an application controls. The link container is the representation of the execution of the file PageDef and gives you access to the collections, methods, and attributes of the data used by a page or view. Context binding is a house while the link container is a piece in.

    Frank

  • Accessing the context property of main.qml to a custom list in a file item separate qml

    Hi all

    Sorry if this is already covered somewhere.

    I currently have an application with a list view in my main.qml.  I put a context property for my class app c ++ to be "app" in my main.qml.  My list uses a custom list item that is defined in a file separate qml.  The custom list item has a popup menu.  In this context menu, I want to call Q_INVOKABLE functions that are part of my class from the main application in C++.  What is the best way to be able to do?  Should I just set the context property on my file qml of list item custom like I do with my main.qml or is there a better way?

    Thank you

    I think that this has been repeated several times, but as it is not really intuitive:
    a listitemcomponent lies in a different context, it cannot access the context property of the qml file.
    You can use the reference to the listview to reach outside, see https://developer.blackberry.com/cascades/reference/bb__cascades__listview.html ListItem.view

  • JDeveloper ADF Mobile - Android context

    Hello

    I'm new to the development of the ADF Mobile. I wanted to use an existing library of android. which requires the context as a parameter because this isn't some back-end database activities. How can I get the Android context if I develop hybrid application using ADF Mobile.

    It's very urgent for the development of mu. Any help is appreciated.

    Kind regards
    Kathia

    Hi, unfortunately I don't think that it is easy to use an existing library of Android, because the JVM Dalvik on Android device is different from the JAVA virtual machine integrated into ADF Mobile. ADF Mobile integrates its own JVM to ensure cross-platform compatibility.

    However, that said, what is the use case exact application you have in mind? In the backend, you mean you are trying to use the Android library communicates with the database server and synchronize data and download data in the local SQLite Database?

    Thank you

    Joe Huang

  • Element of the ADF: access attribute a component when it is inside a foreach statement

    I have the following components:

    < af:foreach >
    < af:table binding = "#{BackingBean.table}" >
    < af:outputtext rendered = "#{BackingBean.table.activeRowKey eq thisRow}" / > "
    < / af:table >
    < / af:foreach >


    When there is only one table, it works fine.
    However, when there is more than one table, for all tables, BackingBean.table.activeRowKey always returns the actieRowKey of the last table.


    I need either to have a smart link who knows which table to return whenever I'm back there, or a way to get rid of the link by doing something like this:


    < af:foreach >
    < af:table >
    < af:outputtext rendered = "#{parentComponent.activeRowKey eq thisRow}" / > "
    < / af:table >
    < / af:foreach >

    The problem is that I have not found a way to get the parent component by using an expression EL (parentComponent.activeRowKey)

    Any Suggestions?

    Thanks in advance!

    Published by: user13362247 on December 1st, 2010 13:40

    Hello

    a table can have a defined selectionListener. He points to a managed bean. As the selection event, you have access to the item (table). I think that should do the trick

    Frank

  • Access to a Java servlet class

    Can make a servlet running on the access of the server has a class defined on server B?
    More information:
    I am new to Java servlet programming and want to make sure that my web application is secure. I've implemented a Java class that returns information from the user (name, address, e-mail etc.) and I put in place of the jsp and servlet pages that access the class through a 'import my.class...» "for servlets and a ' @page import ="my.class... ". ' 'for the jsp. Pages jsp and servlets do session verification and authentication, but the class has nothing of all this - it's methods simply return the requested data. I don't want to put all the identifications in the class, but I want to make sure that there no way to other web servers out there on the internet could access this class in my web application. I don't think it is possible, but my fear is that some hacker out there could do it somehow remotely a @page import "my.class...". "on my Web server and then access my methods of the class? These web applications are run within a Glassfish 3.0 application server.

    Thank you!

    No.. Servlet running on a server can not access anything on server B that are not accessible via HTTP.
    Your class/jar files (and in fact anything under the WEB - INF directory) are not public.

    In fact, if you have WebApplicationA running on the server has WebApplicationB on the same server cannot access the WebApplicationA classes.

    You should not have problems of security in this regard.

    see you soon,
    evnafets

  • Cannot access the context Menu to add input/output formula node

    It is a weird problem. I can't access the menu shortcut in the node of the formula. I right click on the border, nothing happens. Someone at - it will meet it before? Is there another way to add entries and exits?

    I'm running Vision Builder AI and want to use a formula node in my calculator.

    Found.

    In the configuration settings, there is an entry that is default 'hideBDPopupMenus = True'... changed to false and the menu pop.

    Thanks for your help.

    Josh

  • Can not access the context property of the Interior of the ListView checkbox - onCheckedChange event

    I have a context property called "app" that connects to my C++ application. My listview has a box with onCheckedChange event listener. In this method, when I make a call to the C++ side. application app.runAction, the system displays not found error app.

    If I move the box outside the list view, it will correctly trigger app.runAction.

    Can you please take a look? Thank you!

    On the side of C++ on how I set the context property.

    QmlDocument * qml = QmlDocument::create("asset:///main.qml").parent(this);

    If (qml-> {hasErrors())}
    Returns false;
    }

    QML-> setContextProperty ("app", this);

    navigationPane = qml-> createRootObject();
    If (! navigationPane) {}
    Returns false;
    }

    QML side

     

    NavigationPane {}
    ID: nav

    {Page}
    ID: mainPage
    {Of container

    {To ListView

    listItemComponents:]
    {ListItemComponent}
    type: 'point '.
    {Of container

    Checkbox {}
    Determine whether the check box should be checked
    According to a value in the data model
    checked: ListItemData.checked
    onCheckedChanged: {}
    app.testAction ();
    }
    }

    This is a scope issue... I really hope the devs find a way to fix it properly apart from this ugly solution:

    You can solve this problem by setting your app variable in the global object Qt

    NavigationPane {
        id: nav
    
    onCreationCompleted: Qt.app = app
    
    Page {
            id: mainPage
            Container {
    ListView {
    listItemComponents: [
            ListItemComponent {
                            type: "item"
                            Container {
                       CheckBox {
                                    // Determine whether the CheckBox should be checked
                                    // according to a value in the data model
                                    checked: ListItemData.checked
                                    onCheckedChanged: {
                                         app.testAction();
                                         Qt.app.testAction();
                                    }
                                }
    

    all code in a ListItemComponent will suffer from this 'framing' question

  • Can not access the context in QML property

    So I have an arraydatamodel in the CPP file, I use qml-> setContextProperty (...) to set it up to allow QML to access, the strangest part is, no matter if I put it in navigationPane Page or a container, it keeps saying can't find not variable, but in the same QML in ListView, they can access it without a problem. The other weird part, it is an another QML is able to access it in the tag of the page, the same model.

    By default of the Jun 02 9000 REVIEWS asset:///main.qml:24 09:12:59.416 com.example.IntervalTimer1.testDev_ervalTimer1a7a2c2e2.427733134: ReferenceError: can't find variable: eventsModel
    By default of the Jun 02 9000 REVIEWS asset:///main.qml:110 09:12:59.416 com.example.IntervalTimer1.testDev_ervalTimer1a7a2c2e2.427733134: ReferenceError: can't find variable: eventsModel

    Here is my code

    import bb.cascades 1.0
    
    NavigationPane {
        id: navigationPane
        backButtonsVisible: false
        // Javascript definition
        function udpateTotalTimeLabel() {
            console.log("In updateTotalTimeLabel function");
            var totalHour = 0, totalMinute = 0, totalSecond = 0;
            // To debug javascript object print function
            var print = function(o) {
                var str = '';
    
                for (var p in o) {
                    if (typeof o[p] == 'string') {
                        str += p + ': ' + o[p] + '; 
    '; } else { str += p + ': {
    ' + print(o[p]) + '}'; } } return str; } console.log("EventsModel: " + eventsModel.size()); for (var i = 0; i < eventsModel.size(); i ++) { var currentEvent = eventsModel.data([ i ]); console.log("EventsEvent: " + currentEvent["EventName"]); totalHour += currentEvent["EventHour"]; totalMinute += currentEvent["EventMinute"]; totalSecond += currentEvent["EventSecond"]; } if (totalHour < 10) totalHour = "0" + totalHour; if (totalMinute < 10) totalMinute = "0" + totalMinute; if (totalSecond < 10) totalSecond = "0" + totalSecond; totalTimeLabel.text = totalHour + ":" + totalMinute + ":" + totalSecond; } function onDataReady() { console.log("Received DataReady signal"); navigationPane.udpateTotalTimeLabel(); newEventSheet.close(); } Page { id: root titleBar: TitleBar { title: "Interval Timer" } ..... onCreationCompleted: { navigationPane.udpateTotalTimeLabel(); console.log("No of EventsModel: " + eventsModel.size()); console.log("In sheet creationCompleted"); mainObj.dataReady.connect(navigationPane.onDataReady); } }

    In the PRC

    // Default empty project template
    #include "applicationui.hpp"
    
    #include 
    #include 
    #include 
    #include "CountdownTimer.hpp"
    
    using namespace bb::cascades;
    
    ApplicationUI::ApplicationUI(bb::cascades::Application *app)
    : QObject(app)
    {
        // create scene document from main.qml asset
        // set parent to created document to ensure it exists for the whole application lifetime
        QmlDocument *qml = QmlDocument::create("asset:///main.qml").parent(this);
    
        // Initialize the Array Data Model for holding events
        this->eventsModel = new ArrayDataModel();
        // For Testing only
        QVariantMap event;
        event["EventName"] = "Event1";
        event["EventHour"] = "00";
        event["EventMinute"] = "01";
        event["EventSecond"] = "02";
        this->eventsModel->append(event);
    
        // create root object for the UI
        AbstractPane *root = qml->createRootObject();
    
        // Registering the QTimer type to QML
        qmlRegisterType("TimerLibrary", 1, 0, "CountdownTimer");
    
        // Setting the access for QML to member variable
        qml->setContextProperty("eventsModel",this->eventsModel);
        qml->setContextProperty("mainObj",this);
    
        // set created root object as a scene
        app->setScene(root);
    }
    
    .....
    
    void ApplicationUI::refreshData()
    {
        emit dataReady();
    }
    

    Thank you.

    The fixed.

    You must call setContextProperty before calling createRootObject.

  • Confusion in the ADF command binding settings - * URGENT * pls help

    Hi all

    I have a table named 'Action' in which the first column is the ActionId. I shot the first column in a command link. By clicking on this link, it will show you a popup where I can see the current details of action.
    My code is as below.

    < af:table value = "#{bindings." OePdActionView1.collectionModel}.
    var = "row".
    lines = ' #{bindings. " OePdActionView1.rangeSize}.
    emptyText = "#{bindings." OePdActionView1.viewable? "{'No data to display.': 'Access Denied.'}".
    fetchSize = "#{bindings." OePdActionView1.rangeSize}.
    rowBandingInterval = '0 '.
    filterModel = "#{bindings." OePdActionView1Query.queryDescriptor}.
    queryListener = ' #{bindings. " OePdActionView1Query.processQuery}.
    filterVisible = "true" varStatus = "vs."
    rowSelection = "multiple" id = "ActionTable.
    inlineStyle = "color: Blue;" width = "1000".
    "partialTriggers =": RulesTable: SaveButton: deleteActionButton: cb11: cb3: cb2.
    selectionListener = "#{bindings." OePdActionView1.collectionModel.makeCurrent} ">"
    < af:column sortProperty = "Actionid" filterable = 'true '.
    sortable = "true".
    headerText = "#{bindings." OePdActionView1.hints.Actionid.label}.
    ID = "c16" width = "105".
    inlineStyle = "background - color:rgb (255,185,185);" ">
    <!-required = ' #{bindings. " OePdActionView1.hints.Actionid.mandatory}"->
    * < af:commandLink text = "#{row.bindings.Actionid.inputValue}" id = "cl3" > * "
    < af:popup id = 'p3' >
    < af:outputText value = "Details of the selected Action.
    ID = "ot26.
    inlineStyle = "make-weight: bold;" color: Blue; "/ >
    < af:panelLabelAndMessage label = "#{bindings." ActionID.hints.label}.
    ID = "plam18" >
    < af:outputText value = "#{bindings." Actionid.inputValue}.
    ID = "ot25" / >
    < / af:panelLabelAndMessage >
    < af:panelLabelAndMessage label = "#{bindings." Parentruleid.hints.label}.
    ID = "plam19" >
    < af:outputText value = "#{bindings." Parentruleid.inputValue}.
    ID = "ot15" / >
    < / af:panelLabelAndMessage >
    < af:panelLabelAndMessage label = "#{bindings." Actiontypecode1.hints.label}.
    ID = "plam14" >
    < af:outputText value = "#{bindings." Actiontypecode1.inputValue}.
    ID = "ot22" / >
    < / af:panelLabelAndMessage >
    < af:panelLabelAndMessage label = "#{bindings." Targetentitytype.hints.label}.
    ID = "plam17" >
    < af:outputText value = "#{bindings." Targetentitytype.inputValue}.
    ID = "ot17" / >
    < / af:panelLabelAndMessage >
    < af:panelLabelAndMessage label = "#{bindings." Targetentitysubtype.hints.label}.
    ID = "plam11" >
    < af:outputText value = "#{bindings." Targetentitysubtype.inputValue}.
    ID = "ot16" / >
    < / af:panelLabelAndMessage >
    < af:panelLabelAndMessage label = "#{bindings." Legacytargetid.hints.label}.
    ID = "plam20" >
    < af:outputText value = "#{bindings." Legacytargetid.inputValue}.
    ID = "ot18" / >
    < / af:panelLabelAndMessage >
    < af:panelLabelAndMessage label = "#{bindings." Legacytargetsubid.hints.label}.
    ID = "plam13" >
    < af:outputText value = "#{bindings." Legacytargetsubid.inputValue}.
    ID = "ot21" / >
    < / af:panelLabelAndMessage >
    < af:panelLabelAndMessage label = "#{bindings." Legacyparentid.hints.label}.
    ID = "plam12" >
    < af:outputText value = "#{bindings." Legacyparentid.inputValue}.
    ID = "ot23" / >
    < / af:panelLabelAndMessage >
    < af:panelLabelAndMessage label = "#{bindings." VersionNumber.hints.label}.
    ID = "plam16" >
    < af:outputText value = "#{bindings." Versionnumber.inputValue}.
    ID = "ot19" >
    < af:convertNumber groupingUsed = "false".
    model = ' #{bindings. " VersionNumber.format} "/ >"
    < / af:outputText >
    < / af:panelLabelAndMessage >
    < af:panelLabelAndMessage label = "#{bindings." Deletedflag.hints.label}.
    ID = "plam10" >
    < af:outputText value = "#{bindings." Deletedflag.inputValue}.
    ID = "ot20" / >
    < / af:panelLabelAndMessage >
    < af:panelLabelAndMessage label = "#{bindings." Seq.hints.label}.
    ID = "plam15" >
    < af:outputText value = "#{bindings." Seq.inputValue}.
    ID = "ot24" / >
    < / af:panelLabelAndMessage >
    < / af:popup >
    * < af:showPopupBehavior popupId = 'p3' triggerType = 'action' / > *.
    < / af:commandLink >
    < / af:column >


    Now the problem is, I have a 'Create a new Action' button, click on one, I can insert a new row in the table of 'Action '. Given that I have converted this column 'ActionId' in a command link, I couldn't enter any value in the newly created row. While I can give values for the other columns and save the changes.

    Please tell me some idea, so that I could use the field "Actionid" such as CommandLink and also support of editing operations.


    Thanks in advance,
    Sabarisri. N

    Try adding the switch to display inputText for insert and commandLink for update.

    Sample:

    
      
          
      
      
      
          
          .
          .
          
    
    

    Jean Lou

  • Why Xcode crash when you try to access the context menu?

    I'm on El Capitan 10.11.3, Xcode 7.2.1 (7 c 1002), MacBook Pro (15-inch, 2.53 GHz, mid 2009), 4 G memory

    Hello TGacctg,

    I'm not aware of any problem. You can post your crash report?

  • How to access all the lines one by one, a table ADF via managed bean

    Hi Experts,

    Hi I'm new in the ADF.

    Could someone help me to fix the case below?

    Scenario - I have a table called Test_T1 that have 4 columns C1, C2, C3, C4. Creation of EO, VO and AM for test_t1.
    When created in pages ADF, I selected the option "automatically exposed components UI in new managed bean" (mynewmanagedbean.java).
    Control data drag and drop Test_T1 table in the page as a table of the ADF.
    Set the properties is read-only C1, C2, C3 and C4 is an input text.
    Add after the table and attathed button action on the mynewmanagedbean.java bean managed.
    At the time of the Test_T1 page filled with a few No.. lines (such as 9).
    How can I access all the lines above through the key without selection of these.
    In fact, I want to print all the rows of the table in the log at the time to press the button.

    Thanks in advance.

    Sorry for the delay, the code was copied from another test case. You can work directly with the line...
    I created a new test case based on the departments of the HR schema table:

    import oracle.adf.model.BindingContext;
    import oracle.adf.model.bean.DCDataRow;
    import oracle.adf.model.binding.DCBindingContainer;
    import oracle.adf.model.binding.DCIteratorBinding;
    import oracle.adf.share.logging.ADFLogger;
    
    import oracle.jbo.Row;
    
    public class DumpRows
    {
        private static ADFLogger _logger = ADFLogger.createADFLogger(DumpRows.class);
        public DumpRows()
        {
        }
    
        public String cb3_action()
        {
            DCBindingContainer bindings =
            (DCBindingContainer)BindingContext.getCurrent().getCurrentBindingsEntry();
            DCIteratorBinding dcIteratorBindings =
            bindings.findIteratorBinding("DepartmentsView1Iterator");
    
            // Get all the rows of a iterator
            Row[] rows = dcIteratorBindings.getAllRowsInRange();
            for (Row row : rows) {
                String depname = (String)row.getAttribute("DepartmentName");
                _logger.info(depname);
            }
            return null;
        }
    }
    

    As you do not have the class of line interface build you must get the attributes in their names. Be careful here, because any misspelling is cought only when you run the application.

    Timo

  • Access to the instance of the Application Module to the users of servlet

    I have a servlet that is required to access the current users request module instance.

    I added the servlet to filter "adfBindings" to access links in the servlet.
    It works very well. I can access all the links in the servlet.
    The security context of the user is also available.
    But the servlet always creates a new instance of request for a user module.
    I tried several ways to access the module of the application.

    I need the servlet to access the actual instance.
    I tried to also pass the State "_adf.ctrl" for the servlet, but without success.

    Is there a way to access the current instance of request module in a servlet?

    Thanks for your help!

    Richard

    I use JDeveloper 11.1.1.3.0 (JDEVADF_11.1.1.3.PS2_GENERIC_100408.2356.5660)

    You can do it. The idea/solution is Jan Vervecken and works as far as I tested it.
    You need build a URL pointing to your servlet with a parameter to transfer the current DataControlFrame. In the servlet to read the parameter and uses it to obtain the current DataControlFrame.

    You can find the thread here what createRootApplicationModule() must be called from a servlet?
    with a sample application and the screen cast to show how it works

    Timo

  • session or the servlet context

    Hi all

    Can I access values of session context and servlet in the code of people...

    Here I want to achieve...
    I want to store a value or a java object in the OCntext application... When the appserver is launched for the first time I want to save the java object in the session and then later I want to user the variable/object in users...


    Let me know if you have pointers...

    Your Java/class code must be stateless and can take this value as a parameter. Whenever you want to use the Java object, you will need to pass the value of the global variable.

  • Context of sequence of LabVIEW user interface access

    I'm trying to find a way convey the context of the sequence into LabVIEW Advanced User Interface. I need to check the values of some globals to the station before opening a movie file.

    I was looking for a way to send a UImessage to frontendcallbacks.seq that contains the context of the sequence, but I couldn't make it work. What is the best way to access the context of the sequence of the user interface?

    Hello

    In your user interface, use the Engine.Globals to get a reference to the StationGobals, then you can use the PropertyObject.GetVal and SetVal to read or write to the necessary StationGlobals.

    Concerning

    Ray Farmer

Maybe you are looking for

  • When I try to download a document or a picture, firefox is not responding.

    Description: A problem caused this program to stop interacting with Windows. Signature of the problem: Problem Event Name: AppHangXProcB1 Application Name: firefox.exe Application Version: 14.0.1.4577 Application Timestamp: 5000b729 Hang Signature: 3

  • Hard drives - power

    Good evening I have a pavillion a6485.it desktop pc with windows 7 32 bitI'm going to buy a secondary internal hard drive for backup and expansion, but I have a doubt... the installed 300W power supply is the owner of the load on the system? Connect

  • SX280 panoramic video

    During panning videos wiwth my SX280 I always try to be as smooth as possible.  However, the videos that result are slightly jerky.  The unit is set at 640 x 480.  Is it possible to get smoother videos?

  • Systems compatibility

    The series is compatible with Linux?

  • Buenas tardes como hago para that el player of windows me reproduzca formato dvd__

    Means - This is a foro Público para as information private as numbers of Teléfono o correo electronico nunca! Ideas: Programs are having problemas con Los error messages Los recent changes made in su equipo What is han tratado did el problema