Accessing memory scope attributes using Java

hello guys, am wondering if there is anyway to access a memory scope attribute dynamically using java,
lets say i have a value stored in application scope, #{applicationScope.MemberId}
can i get that value in a java class directly without binding the value to a hidden UI component ??
thanks in advance
Saidi.

ADFContext.getCurrent().getApplicationScope()
Check ADFContext (Oracle Fusion Middleware Java API Reference for Oracle ADF Share)
Dario

Similar Messages

  • Accessing Session scope attributes in ADF BC

    Is there any groovy script for accessing session scope variables in ADF BC?

    Let me put forward my use case:
    My VO's in my application has a bind variable which is bound to currently logged in user (adf.context.securityContext.userName). Also my application has couple of AM's
    But now i'm adding complexity to my application where i'm implementing super user concept, a super user can login to the application, select a username (say 'user1'), and see the application as if 'user1' is logged in.
    So i'm trying to solve the problem by setting a session attribute for the user ('user1') and make it use in VO's
    Do you guys have any better solution to this problem?

  • JVM - Microsoft JScript.dll Memory Leak when using Java Web Start

    I have posted before a topic related to this matter, although now I have a lot more information about what is going on (although still no fix for it). This is the link to the earlier post, containing JVM HOTSPOT EXCEPTION_ACCESS_VIOLATION
    http://forum.java.sun.com/thread.jspa?threadID=5116970&messageID=9402346#9402346
    The issue is that after deploying on Windows XP a multi threaded, memory consuming (40 Mb) Java Swing application using Java Web Start, and the standard web page (IE6) reference to the jnlp file to launch the installation from Tomcat, each time this application gets executed by double clicking on the desktop icon (with no IE6 interaction at all), calls start being made between jvm.dll (sun) and jscript.dll (Microsoft IE), these interactions never release the memory they consume, so after a period of using the application it crashes unavoidably. If I execute exactly the same application launching it from command line (no Web Start nor IE6 browser involved), the application works nicely all the time, no problem at all.
    My question is: does anyone know why these calls to jscript.dll are even being made during web start application execution? As said, it's a desktop Swing app, it does not need the browser at all, and jscript.dll is a IE dll. Anyone can advice on how these interactions can be eliminated?
    I've worked with Microsoft support for two weeks on this issue and all they have said is that it is a Sun problem and they can not help further.
    Thanks
    Jes�s

    Microsoft suggested (among others) two test.
    1- Install IE7 and run the application
    2-Install Firefox and run the application
    Results were:
    For 1: The application does not crash, apparently IE7 has a newer version of Jscript.dll that, in Microsoft words, handles better 'bad software', refering to 'bad software' to the java virtual machine I guess. Looking at the performance manager you can see memory goes down as with IE6, but at some point memory is released and the app. does not crash. Anyway is still is uncertain to me why Jscript.dll is getting involved at all. Although this solves the problem is not a viable solution for us, because I work in a corporation where changes such as upgrading the IE version on a large number of desktop can not be justified just because one app. is crashing, and it would take a long validation time anyway before the upgrade can proceed.
    For 2: I did install Firefox in a machine and the application still crashed, but it is true I did not uninstall IE6, so the conflictive Jscript.dll was still sitting at system32. Quite possibly the crash would not happen if that dll wasn't there at all.
    Thanks
    Jes�s

  • Access microsoft word doc using java

    how can i access microsoft word using java .
    I want to select text from the word in the same format as it is.
    if possible can u all help me

    By using an appropriate library. JText, whatever.
    Google, man.I think Rene meant iText!Whatever. :) Never used it, I just remembered there was something named like that. Thanks.

  • Accessing files in directory using Java SP in 10g

    Hi all-
    I have set up a directory in 10g which points to an existing directory in the operating system and am trying to get the list of files in it from a Java stored procedure. The directory in Oracle is called "Upload_to_Oracle" and am trying to get the files in the sp by calling:
    File f1=new File("Upload_To_Oracle");
    File fs[] =f1.listFiles();
    System.out.println("The count of files is " + fs.length);
    The problem is fs is null, so fs.length causes an exception to be thrown. Initially I was getting an error:
    the Permission (java.io.FilePermission Upload_To_Oracle read) has not been granted to ILFORD. The PL/SQL to grant this is dbms_java.grant_permission('ILFORD', 'SYS:java.io.FilePermission', 'Upload_To_Oracle', 'read')
    which I (think) I resolved by executing that command as SYS (this is a dev box used by just me) and logging out of sqlplus and back in.
    I haven't been able to find anywhere how you're supposed to reference an Oracle directory in Java, so in all honesty, I don't know if this is how you're supposed to do it.
    Any help would be appreciated.
    Thanks,
    Ilford

    I figured it out for anyone who needs something similar; the problem is that the Oracle directory is specific to particular files that Oracle will use for loading (BFiles, etc.). To get at the file system directory, I just needed to reference the actual system directory itself, as well as grant it permission.
    So what it comes down to is that you should reference the directory in File() as if it truly were a regular Java app on the filesystem, making sure the appropriate permissions are set for both the user running Oracle (for file/directory access) as well as for Java access.

  • How to access .asmx Web Service using JAVA? Newbie

    Hello Experts,
    Currently, I have a project where in I have to access a ,NET web service. It is made of C#. I just want to ask how will I start the accessing process? I made this simple equation on how my project is.
    Java Project + C#.Net Web Service = Integration
    1. Do i need to create a Web Service too for the Java Project? If yes, What are the necessary tools needed for the creation of this Java Web Service?
    2. The .NET Web Service is available online. (It is made by other people).
    3. Based on the equation, what is the equivalent technology for the + sign?
    4. Can you site a concrete example for accessing a web service?
    5. I'm new here. Totally I have no idea where to start.
    6. Thank you experts.
    Edited by: Benedict.Aluan on 05 30, 08 1:38 PM
    Edited by: Benedict.Aluan on 05 30, 08 1:39 PM

    Hello
    Thanks a lot for your help ...
    I am developing simple J2EE based web service client using IBM WSAD 5.1. I have used the following code to call .asmx web service in Java
    String url = "http://www.w3schools.com/webservices/tempconvert.asmx?wsdl";
         String namespace = "http://tempuri.org/";
         name = request.getParameter("txtName");
         try
              System.out.println("In Internet Service");
              ServiceFactory factory = ServiceFactory.newInstance();
              Service serv = factory.createService(new URL(url),new QName(namespace,"TempConvert"));
              System.out.println("Got Service......");
              Call obj = (Call)serv.createCall();
              System.out.println("Got Call......");
              obj.setProperty(Call.ENCODINGSTYLE_URI_PROPERTY,"");
              obj.setProperty(Call.OPERATION_STYLE_PROPERTY,"wrapped");
              obj.setTargetEndpointAddress(url);
              obj.setPortTypeName(new QName(namespace,"TempConvertSoap"));
              obj.setOperationName(new QName(namespace,"FahrenheitToCelsius"));
              obj.addParameter("param1",XMLType.XSD_STRING,String.class,ParameterMode.IN);
              obj.setReturnType(XMLType.XSD_STRING);
              System.out.println("Parameters Set.....");
              Object[] params = new Object[]{name};
              k = (String)obj.invoke(params);
              System.out.println("Result: "+k);
         catch(Exception e)
            System.out.println("Exception is : "+e);
        }But this code is throwing exception that
    Invalid Address "http://www.w3schools.com/webservices/tempconvert.asmx?wsdl"I have also tried this URL with Java Proxy. But it showing the same error.
    Plz can u tell me how to access .asmx web service ?
    Waiting 4 reply.

  • How to create a ms-access database at runtime using java

    hi, this is ravi kiran,
    i have a situation where i need to create a new ms-access database with one table in it at runtime(when user clicks on some button).
    i have been searching many sites to know how to do this in java, but i didnot find any thing useful.
    plz tell me how to do this in java.
    plz help me, its urgent
    thanx in advance.

    Here's how I did it. Research does help, but sometimes looking at others code does too... You do have to have a dummy file that you made with access though. You can't just make a file file.mdb (it will be corrupt)
         public void createDatabase(String database) throws SQLException{
              try{
                   // This file needs to have been created with MS Access
                   File dbfile = new File(this.dataBaseDir + "dummy.mdb");
                   // This is the new database file being made
                   File newFile = new File(this.dataBaseDir + database + ".mdb");
                   // Copy all bytes from dummy file to new DB file.
                   FileInputStream instream = new FileInputStream(dbfile);
                   FileOutputStream ostream = new FileOutputStream(newFile);
                   int numBytes = instream.available();
                   byte inBytes[] = new byte[numBytes];
                   instream.read(inBytes, 0, numBytes);
                   ostream.write(inBytes, 0, numBytes);
              catch(FileNotFoundException e) { e.printStackTrace();}
              catch(IOException e) { e.printStackTrace();}
              if(DEBUG) System.out.println("creating the " + database + " database");
         }

  • Accessing Exchange Profile Parameters programatically (using Java/ ABAP)

    Hi All,
    Exchange Profile parameters can be accessed using the URL http://<server>:<port>/exchangeProfile
    Does anyone know how to access 'Exchange Profile parameters' programatically. (from java).
    Code snippet for the same would be of great help.
    Regards,
    Siva Maranani

    Hi,
    Is there any way to access exchange profile parameters using Java?
    I need to access exchange profile from an UDF.
    Thanks in advance.
    Pedro Leal

  • Accessing Microsoft Outlook address Book using java

    Hi All,
    Can anyone tell me how can i access outlook address book using java or java script
    Thanks in anticipation,
    Reagrds,
    Preeti Gupta

    www.microsoft.com/java/sdk/default.htm
    support.microsoft.com/support/kb/articles/Q168/9/42.asp
    Hope this helps you.
    Rajesh

  • Problem of accesing MS Acess database on Linux using Java

    Below is my java code and errors found. Can anyone guide me tell me what is the problem and how to success access the .mdb file using Java on Linux?
    import java.sql.*;
    class readmdb
    {      public static void main(String[] args)
    {    String url;
    Connection con;
    Statement stmt;
    try
    {     Class.forName("sun.jdbc.odbc.JdbcOdbcDriver");
    catch(java.lang.ClassNotFoundException e)
    {    System.out.print("ClassNotFoundException: ");
    System.out.println(e.getMessage());
    try
    {     con = DriverManager.getConnection("jdbc:odbc:DRIVER={/usr/local/lib/libmdbodbc.o.O}};DBQ=/home/powerstation/db/Database.mdb");
    stmt = con.createStatement();
    stmt.close();
    con.close();
    catch(SQLException ex)
    { System.err.println("SQLException: " + ex.getMessage());
    Errors messages found after i executed the java code
    shown above on linux platform.
    Exception in thread "main"
    java.lang.NullPointerException
    at sun.jdbc.odbc.JdbcOdbcDriver.initialize(JdbcOdbcDriver.java:436)
    at sun.jdbc.odbc.JdbcOdbcDriver.connect(JdbcOdbcDriver.java:153)
    at java.sql.DriverManager.getConnection(DriverManager.java:512)
    atjava.sql.DriverManager.getConnection(DriverManager.java:193)
    at readmdb.main(readmdb.java:27)

    jschell,
    ODBC shell is the odbc.ini or odbcinst.ini? No.
    The shell is something that you explicitly installed. Just like you installed Apache, or perl, or a C++ compiler, or even a CD driver.
    If yes,
    What is the difference between odbc.in and
    odbcinst.ini? No idea. But on a windows box those are ini files that specify odbc info. I don't think ini files are going to help on linux.
    Which of them will be execute when i
    want to establish a connection using "jdbc:odbc:...."
    in DriverManager.getConnection?I am rather sure that neither of them would 'execute'
    >
    Is it MS Access ODBC linux driver is the file like
    libodbc.so, libmdbodbc.so, libmdbsql.so and so on?No idea, but I doubt it.
    What makes you think that you even have a MS Access ODBC linux driver on your box?
    Then, can u tell me which is MS Access ODBC linux
    driver or what is the driver file name for MS Access
    ODBC linux driver?Nope.
    If you installed a MS Access ODBC linux driver, then the ODBC shell will know where it is.
    And if you did install such a driver you should post the link where you got it here, because as far as I know, there is no such driver (nor is there one for MS SQL Server.)

  • Process Identification using java- GUID

    How can I access a process identifier using java code?
    in fact i am developing a Group communication application, in which multiple processes communicate each other, and this requires unique identification of each process. for example to determine the sender of a message, i need identifier of the process which has sent the message.
    So please sugest me how can I use Process Identifier or Is there any alterative way, for example I have an idea to use some Globally unique identifier (GUID) for each Process involved, But I dont know actually how to implement that Gloabally Unique Identifier (GUID). Please help me to solve this issue.

    NadeemAbbas wrote:
    How can I access a process identifier using java code?You can't.
    >
    in fact i am developing a Group communication application, in which multiple processes communicate each other, and this requires unique identification of each process. for example to determine the sender of a message, i need identifier of the process which has sent the message.How do they communicate? Sounds like the socket is the identifier.
    Kaj

  • Access object attributes using other object JNI native method

    Hi. I'm trying to change an attribute of object O1 from another object O2 without invoking a O1 method and without making the attribute as public or protected.
    The only possibility that comes to my mind for doing so is writting a JNI native method
    public class O1 {
    static public native changeAttribute (Object O2, Object newAttributeValue) ;
    that change the attribute memory reference, but all I've found about accesing attributes in JNI is about accessing the invoker attributes (in this case, O1).
    �Does any one know if it's possible to do so? Thanks.

    I know that is not a good practice but I cannot figure out another way.
    I'll try to explain the whole problem so you see the reason. I'm working with transactions, using objects as the data. An object can be opened for write by several transactions because the granularity for conflicts is not the object, is each of its attributes. As long as two transaction don't write the same attribute, they both can write. For writing, each transactions uses a private copy of the object. At committing, the actual copy of the object must be replaced by the committer one, but as far as the granularity is the object attributes, only each written attribute must be replaced (if not, only the last commit would be visible).
    This attribute replace must be done by the transaction manager as far as the transactional object is provided by the client. So what i was thinking was to use JNI or some trick like that to replace the object attributes transparently to the object.
    I hope the explain is clear, my english is a little asleep :-(.
    How to do it with reflection? I thought that was only for method calling. Anyway, there wouldn't be problems if the attributes are private?
    Thanks for answering.
    EDIT: I've been able to change a public field using reflection, but not the private one
    import java.lang.reflect.*;
    class Caca {
    public static void main(String[] args) {
    Integer r = new Integer(0);
    System.out.println("original: " + r.toString());
    modifyWidth(r, 300);
    System.out.println("modified: " + r.toString());
    static void modifyWidth(Integer r, int newValue ) {
    Field valueField; Class c = r.getClass();
    try {
    valueField = c.getField("value");
    valueField.set(r, newValue);
    } catch (Exception e) { System.out.println(e); }
    Message was edited by:
    dfasdfsdafsadfasdf

  • Java Bean scope when used with the JPDK

    Portal 3.0.9.8.4 and Jserv
    When using JSPs with Java Beans and the JPDK I have noticed problems when setting the scope attribute of the useBean action to something other than "page". For example, &lt;jsp:useBean id="provider" scope="session" class="MyClass" /&gt; causes a java.lang.ClassCastException when there are more than two JSP portlets than attempt to access the ProviderSession object.
    Does anyone know what value the JSP scope should be set to when you want the JSPs read/write to the ProviderSession?

    The behavior you report is an expected one as your keys of objects on session are not unique to the two portlet instances. Two portlets with the same session object (may have been deployed on the same Portal page), are sharing the same object put on session, thus resulting in thread conflicts. What you need to do is to generate unique keys for objects stored for each portlet instance.
    For example, instead of having the id as "provider", you should have it as <portlet instance name> + "provider".
    You are not experiencing the same behavior in "request" or "page" scope, as in these scopes, the objects are not shared across portlet instances.
    Please let me know if my interpretation of your issue is wrong.
    Regards,
    Abhinav

  • Possible deadlocks with in-memory database using Java

    I've written a completely in-memory database using the Java API on BDB 4.6 and 4.7 for Windows and Linux (x86). The completely in-memory database means the database content and logs are entirely in-memory and the overflow pages will not be written to a disk file.
    The database environment and the database are configured to be transactional. All database access methods are specified to be auto-commit by setting the transaction argument to null. The environment is configured to be multi-threaded (which is the default when using the Java API).
    When run with a single-threaded client, the application works correctly on both Windows and Linux for BDB 4.6 and 4.7.
    When run with a multi-thread client that uses two thread for the database access, I run into a deadlock inside the call to the Database.delete method about half the time.
    I am assuming that in the "auto-commit" mode, a deadlock should not be possible.
    Any reported problems with using Java with in-memory database?
    Thanks.
    Hisur

    Hi Hisur,
    If you are using transactions and multiple threads, you will have to deal with deadlock. In this particular case, it's likely that a delete is causing two btree pages to be merged (called a "reverse split"). Auto-commit makes no difference in this case -- the application must retry the operation.
    Regards,
    Michael Cahill, Oracle.

  • Accessing device registers and microcontroller registers using java

    We are writing an application that needs to work with any kind of microcontroller(more specifically targetted towards 8051 and 80188/86 microcontrollers) in a constrained memory environment with code/data not
    more than 128 KB or at the most 256 KB.
    We would look at using the JVM in hardware rather than software as an accelerator chip on our boards..
    However I wanted to know whether there is a way wherein I can accomplish the above platform independence for microcontroller and still access low level registers for the memory mapped I/O devices using Java..
    If anybody knows about this please let me know at
    [email protected]

    Not in pure Java, although you can do that in JNI. But if this is the main purpose of your program, you might as well use C++ or some more low-level language.

Maybe you are looking for