Retrieve applet object

I'm fairly new to Java and I've been concentrating my efforts in applet programming. One thing I've noticed is that I seem to require the Applet object a lot in my code as I'm doing a lot of file reading (applet.getCodeBase, etc). I have a few instances in my code where I pass the applet object to different packages to perform basic operations and I'm starting to feel as if I'm doing this wrong.
Is there a way to obtain the applet object using a global static function?

Hi Mr Lob, will you think about the fact seriously that still no one seems to have understood your problemI know, the talent here is shocking.
As often illustrations could help...I agree when you are demonstrating algorithms, discussing implementation, compilation errors etc. Mind, I would have knocked something up for you if you'd have responded with some decency and not made out there was a problem with my post. Telling me to post a demo is impolite, you could have asked to see something and I would have gladly responded. You don't know me & I don't you know, so you shouldn't assume you have superiority over me.
I just wanted a brief code that could illustrate your problem/issue.You'd have a class declaration (unrelated to 'Applet') with an empty function member, in it would be a comment saying:
// I would like to get applet object the libraries invoked at this point in the code...Close your eyes and imagine it...
So it is plain obvious that the looser in these word battle is you, not petes1234 et al.LOL. Firstly, I never said petes1234 was a 'loser', he's just an idiot for posting unrelated & directly offensive comments. It's water off a ducks back, mind. Secondly, there's no way I'm a loser posting what I have. However, I will settle for 'loser in the quest to find an accomplished Java programmer within this public forum.'
I thought I was a part of the 'do-not-help' list? Why are you still posting? Let it lie...
Just so you know, I found an answer to my question elsewhere asking exactly the same thing. Now, .... "Think about that!"

Similar Messages

  • Unable to retrieve system object

    An exception occurred while processing a request for :
    iView : pcd:portal_content/com.sap.pct/specialist/com.sap.pct.crm/com.sap.pct.crm.roles/com.sap.pct.crm.salesrepresentative/com.sap.pct.crm.sal.sales/com.sap.pct.crm.ord.orders
    Component Name : com.sap.portal.appintegrator.sap.BSP
    Exception in SAP Application Integrator occured: Cannot retrieve system object for this alias. System Alias: 'SAP_CRM', System ID: 'pcd:portal_content/PCR_CRM-IDES'. User: 'SALESREPS', Reason: Access denied (Object(s): portal_content/PCR_CRM-IDES).
    Exception id: 10:50_24/06/07_0034_4060050
    See the details for the exception ID in the log file
    any hope for solving this ERROR

    Hi rahul,
    1) check your permission setting as mentioned above and with read/write for "Everyone"
    2) In the same screen, next to "Everyone", there is a checkbox. Make sure that you have the "Enduser" flag
    Those are the 2 settings you have to make sure that is done in order to process iviews connected to your backend (system alias) systems.
    Hope that help.

  • At what percent e-tester can identify java applet objects. Plz see message.

    Hi,
    Me new to this group.
    I am here to find out whether e-tester can test java applet or not.
    I am testing a web application which is completely Java applet base.
    Envirnment used jdk1.1.8 and Jre1.4.
    I have been trying to identify applet object used in our application.
    problem i faced:
    when i set java option in option seting for both Microsoft applet and sun system applet. where my system having jdk1.1.8 and jre1.4.
    Recording on above envirnment I am able to record my application but i can not play that. On this case I marked Abbot script generated.
    when uninstall jdk and jre.
    I am able to record and play my application still some step. But I am not able to customize it.
    this application also uses StarTree a hyporbolic tree API from
    "Business Object" now bought by SAP (this api used inside applet
    frame).
    Is any one work on e-tester to automate in and out of an application which is built in java applet.
    Can some one help me to figure out where I am doing wrong.
    Before this I worked on e-tester year back to automate one of our application and still we are doing our regression on that.
    Expecting some help

    When you say customize, are you referring to parameters? They is handled differently with applets. I believe there is documentation on this.

  • Could not retrieve System Object  for the alias.

    Hi all,
    I have installed a business package (Maintenance Technician) and created system SAP_PM with aliases SAP_ECC_Manufacturing, and SAP_ECC_Common.  When I am logged into portal using Super Admin role, all the iviews of business package are working fine.  But when I am logged in using normal user, all iviews in the business packages are throwing the following exception.  Any ideas why? I appreciate your input.
    <b>Exception in SAP Application Integrator occured: Cannot retrieve system object for this alias. System Alias: 'SAP_ECC_Manufacturing', System ID: 'pcd:portal_content/com.xyz.fl_systems/com.xyz.SAP_PM'. User: 'abcuser',
    Reason: Access denied (Object(s): portal_content/com.xyz.fl_systems/com.xyz.SAP_PM).</b>
    Thanks
    Vicky R.

    Hi Vicky,
    can u pls share ur experience how did u solve this problem, i too facing the same problem.
    what i did  created one user who is already existed in BI System and created few iviews related to BI Reports.
    when i logged in through that user id in portal , while executing system is throughing the error what u have faced.
    Could u please let me know how did u solve that problem.
    Thanks in Advance
    RamanaRao V

  • JavaScript's Applet Object

    I am trying to use JavaScript's Applet object to access my applet in the left frame, from a java script embedded in a JSP file in the right frame.
    I can assign the object to a variable as in:
    var ap = parent.frames["leftframe"].document.applets[0];
    But when I try to call a public method on the applet as in:
    ap.TestApplet();
    I get an error in the page saying:
    Error: Object doesn't support this property or method.
    My applet was embedded in the left frame with <jsp:plugin> tag. So I am not directly using HTML's Applet tag. So I am not able to pass MAYSCRIPT flag to the HTML's applet tag. Question is, do I need MAYSCRIPT flag for what I am trying to do? If so, is there any way to pass MAYSCRIPT flag?
    Thanks for any help.
    - Krishna.

    Does anyone have any thoughts on this?
    Thanks,
    Krishna.

  • Inter-applet object shareing concepts in java card

    hi there.
    what is a way of implimenting inter-applet object shareing in java card?
    is there any shared area of JCRE for sharing some values among some applets in same java card?
    thanks.

    hi, as i know, there are three approaches:
    1: shareable interface;
    2: entry point;
    3: global array;
    and if the applet has JCRE privilege, then it is overwhelming.
    for details , please refer to the JCRE Specification.

  • Get Applet object

    Hi everybody,
    I have several frames in an HTML page (nothing in static, all is generated).
    I have 1 applets in the frame 1 and an applet in the frame 2.
    I would like to get the applet object (java.Applet.applet) of the applet 1 in the applet 2 ...
    How could I do ?
    For the moment, I get :
    JSObject jsXelonContainer = (JSObject) ((JSObject) ((JSObject) window.getMember("top")).getMember("frames")).getMember("myFrame1");
    JSObject myDoc = (JSObject)jsXelonContainer.getMember("document");
    JSObject applets = (JSObject)myDoc.getMember("applets");
    Nothing is null at this point. But I don't know how to get the Applet I want from the "applets"
    May be is there another simplier way ...
    Any idea ?
    Thanks in advance
    Rafax.

    Ok.
    In my case, it is an applet.
    - The code declaration :
    <OBJECT classid="clsid:8AD7C840-044E-11D1-B1E9-00805F499D93" width="200" height="200" align="left"
         codebase="http://java.sun.com/products/plugin/1.2.2/jinstall-122-win32.cab#Version=1,2,2,0" name="bootstrap" >
         <PARAM NAME="code" VALUE="com.elogiq.xelon.client.web.bootStrap">
         <PARAM NAME="archive" VALUE="../jar/myArchive.jar">
         <PARAM NAME="codebase" value="./class">
         <PARAM NAME="type" VALUE="application/x-java-applet;version=1.3">
         <PARAM NAME="name" value="myApplet">
         <PARAM NAME="scriptable" value="true">
         <PARAM NAME="MAYSCRIPT" value="true">
    </OBJECT>
    the classId your are saying ... is it the classid ? (I don't think, but ...)
    Thanks,
    Rafax

  • Applet object

    can i somehow get the refernce of the applet object which the browser creates.
    i am writing a class which has to b deployed in a web server.
    can i get the ref of the applet object which the browser makes on a client request
    thanx in advance.
    Pradnya

    You mean you want to get a reference to an Applet instance on the server?
    I would imagine that in the majority of environments this is not possible.
    Could you provide more information about what you're trying to do?

  • Applet/object param name="legacy_lifecycle" value="true"/ documentation?

    I've recently stumbled across this applet/object parameter as a solution to a problem. However I can't find the official documentation of it anywhere, and believe me I've looked. I did find a reference to it in some Oracle product documentation but nowhere in the Java Plugin or Deployment documents. Has anybody spotted it anywhere? Urban myth? Legend? It certainly seems to work.
    Edited by: EJP on 6/03/2012 20:36: corrected typo in title

    Searching an old jdk source download shows it is not used by Java per se.
    $ pwd
    /home/download/java/src/jdk-6u23-fcs-src-b05-jrl-12_nov_2010
    $ find . -type f -exec grep -H legacy_lifecycle "{}" \;
    deploy/src/plugin/share/classes/sun/plugin/AppletViewer.java:        String lifecycle = getParameter("legacy_lifecycle");
    deploy/src/plugin/share/classes/sun/plugin2/applet/Applet2Manager.java:        String lifecycle = getParameter("legacy_lifecycle");
    deploy/src/plugin/share/classes/sun/plugin2/applet/Applet2ManagerCache.java:if (appletParameters.get("legacy_lifecycle") == null)
    deploy/src/plugin/share/classes/sun/plugin2/test/LegacyTest2AppletFrame.html:Legacy Lifecycle Automated Test #2 -- two legacy_lifecycle applets on the same page
    deploy/src/plugin/share/classes/sun/plugin2/test/LegacyTest2AppletFrame.html:<param name="legacy_lifecycle" value="true"></param>
    deploy/src/plugin/share/classes/sun/plugin2/test/LegacyTest2AppletFrame.html:<param name="legacy_lifecycle" value="true"></param>
    deploy/src/plugin/share/classes/sun/plugin2/test/LegacyTestAppletFrame1.html:Legacy Lifecycle Automated Test #1 -- two legacy_lifecycle applets in different frames
    deploy/src/plugin/share/classes/sun/plugin2/test/LegacyTestAppletFrame1.html:<param name="legacy_lifecycle" value="true"></param>
    deploy/src/plugin/share/classes/sun/plugin2/test/LegacyTestAppletFrame2.html:<param name="legacy_lifecycle" value="true"></param>
    deploy/src/plugin/share/classes/sun/plugin2/test/liveconnect/LegacyLifecycleLiveConnect.html:Tests LiveConnect against a legacy_lifecycle applet. Reload and switch
    deploy/src/plugin/share/classes/sun/plugin2/test/liveconnect/LegacyLifecycleLiveConnect.html:    <param name="legacy_lifecycle" value="true">
    $

  • Cannot Acccess Applet Object from Java Script

    Hi,
    I am using jRE1.5, and Kava Chart Applets. Those applet jars are compiled in jdk 1.5 version. I have created one jsp where I used ,<applet> tag. The problem is when ever I am going to access the applet object from java script it is not returning the actual java applet object, when put an alert message it shows [object]. So i am not able to access the methods or the applet class.and also the screen gets hung, nothing is coming.It get stuck at the point where i tried to access the applet method like document.getElementById(applet_id).<<<some method of the applet class>>.Also it is not showing any kind of javascript error or Applet class exceptions.
    But the strange thing is, when i use jdk 1.6, the page is running fine.Also when i try to print the applet object from javascript it is showing the proper class name.
    Please help me solving the problem.

    A number of changes and improvements were made between 1.5 and 1.6 - the entire plugin is new. You need to change to 1.6, as 1.5 goes EOL about November this year and future changes to this area in 1.5 are unlikely.

  • Retrieving All Objects From Session

    I'm developing a JSP shopping cart application, i have problem with sessions. A user can add a product to their cart, this adds the product name and the product price to the cart using:
    <%
    session.setAttribute("pname", pname);
    session.setAttribute("pprice", pprice);
    %>
    The problem I have is viewing the cart. The page must display all items the user has added to the cart. I need to retrieve all the objects from the users session.
    session.getAttribute("pname") will only return the last object which was added to the session. Is there a method or mechansim to loop through all the objects in a users session?
    Any suggestions appreciated.

    session.getAttribute("pname") will only return the
    last object which was added to the session. Is there a
    method or mechansim to loop through all the objects in
    a users session?You can't use session.setAttribute("pname",pname); repeatedly. Each time it will overwrite contents of existing attribute. Thats the reason why you are always getting last added value.
    You can do one thing. Add pname to the Vector or Hashtable, like this,Vector v = (Vector) session.getAttribute("pname"); // Get the existing Vector in the session.
    if(v == null) v = new Vector(); //If there is no attribute "pname" in the session, create an object of Vector.
    v.add(pname) //add item to the Vector.
    session.setAttribute("pname",v); //Now add this vector to the session.Hope this helps.
    Sudha

  • How To Retrieve an Object's Value Defined Using c:set ... Tag?

    I have the value of a variable defined in JSP#1 (JSP#1 is not a form) using JSTL tag:
       <c:set var="id" value="${articleForm.article}" scope="session"/>Now, I have an object 'id' in the session scope. The object 'id' and all the information, which are defined in JSP#1, are forwarded to JSP#2.
    JSP#2 is a form. But, the 'id' is not used in JSP#2.
    JSP#2 has a submit button and then, a servlet takes over the control after that button is clicked. All the text fields in JSP#2 together with the object 'id' are forwarded to this servlet.
    I have two questions:
    1. I should put this object 'id' in a request scope or a session scope? Currently, it is in a session scope.
    2. How to retrieve the value of this object 'id' in this servlet? (I do not want to print the value out. I want to retrieve the value and store it in a database.)
        int articleID = Integer.parseInt( session.getAttribute( "id" ) );   or, it should be retrieved in another way?

    I'm not sure you understand the concept of a session object.
    Java objects stay on the server. There is no transmission between the web browser and the client.
    The scope just sets how long the server "remembers" that variable.
    request scope - only lasts one request. Once a web page is returned to the client, the server forgets all request variables.
    session scope - lasts for one user - across multiple requests/web pages.
    1. I should put this object 'id' in a request scope or a session scope? Currently, it is in a session scope.From your description, you appear to have it right - your object should be in session scope.
    2. How to retrieve the value of this object 'id' in this servlet? (I do not want to print the value out. I want to retrieve the value and store it in a database.)If articleForm.article is an String then that looks the right way to access it.
    You might have to do it like this:
    int articleID = Integer.parseInt( (String)session.getAttribute("id"));
    The Integer.parseInt method takes a String as a parameter - while session.getAttribute() returns an Object.
    This code will work if the object stored in the session is a String.
    The object stored in the session is ${articleForm.article} What type does articletForm.getArticle() return? That is the type you need to cast it to when retrieving it from the session.
    Cheers,
    evnafets

  • Servlet applet object io streams

    hi! i have an applet and servlet which communicate through objectoutputstreams.
    here's part of my applet code found in the init method:
    hostServlet = new URL( "http://localhost:8080/scheduler/servlet/EditSchedule" );
    hostConnection = (HttpURLConnection)hostServlet.openConnection();
    hostConnection.setRequestMethod( "POST" );
    System.out.println( "connected" );
    //set headers
    hostConnection.setDoInput( true );
    hostConnection.setDoOutput( true );
    hostConnection.setUseCaches( false );
    hostConnection.setDefaultUseCaches( false );
    hostConnection.setRequestProperty( "Content-Type", "application/x-java-serialized-object" );
    //stream to servlet just to specify that we're using post not get
    oos = new ObjectOutputStream( hostConnection.getOutputStream() );                                      
    oos.writeObject( "inside" );                                                
    oos.flush();
    oos.writeObject( "inside2" );
    oos.flush();
    //get objects being passed by servlet
    ooi = new ObjectInputStream( hostConnection.getInputStream() );
    here's part of my servlet code in the doPost() method:
    ObjectOutputStream oos = new ObjectOutputStream( response.getOutputStream() );
    ObjectInputStream ois = new ObjectInputStream( request.getInputStream() );
    response.setContentType( "application/x-java-serialized-object" );
    oos.writeObject( object );               
    oos.flush(); 
    oos.close();     
    //read objects
    FileOutputStream fw = new FileOutputStream( "c:\\objectsRead.txt" );
    ObjectOutputStream objectFw = new ObjectOutputStream( fw );
    objectFw.writeObject( "from servlet" );
    objectFw.flush();                                 
    String inside = (String)ois.readObject();
    objectFw.writeObject( inside );
    objectFw.flush();
    String outside = (String) ois.readObject();
    objectFw.writeObject( outside );
    objectFw.flush();
    objectFw.close();both the inside and inside2 objects get written to my textfile. Although, in my applet, if i outputted inside2 after creating the objectinputstream, only inside1 gets written. This is my problem. I have to write back to the servlet way passed the ooi instantiation of the applet. Specifically, in an event handler outside the init method.
    any help would be greatly appreciated! =)

    another weird thing that i found out.
    when i use the syntax:
    oos.writeObject( "something" );
    -->it gets passed to the servlet while
    String str = "something";
    oos.writeObject( str );
    -->doesn't get passed.
    hmm....
    i tried setting the content type to application/octet-stream but still nothing.

  • Servlet Applet object communication problem???!!!

    Hy folks,
    I need to validate the ability of complex Servlet Applet communication an run into my first pb right at the beginning of my tests. I need to have around 200 Applet clients connect to my servlet and communicate by ObjectInput and ObjectOutput streams. So I wrote a simple Servlet accepting HTTP POST connections that return a Java object. When the java Applet get instantiated, the Object Stream communication workes fine. But when the Applet tries to communicate with the servlet after that, I can not create another communication session with that Servlet, instead I get a 405 Method not allowed exception.
    Summarized:
    - Applet init() instantiate URLConnection with Servlet and request Java object (opening ObjectInput and Output Stream, after receaving object, cloasing streams).
    - When I press a "get More" button on my Applet, I am not able to instantiate a new URLConnection with my servler because of that 405 exception, WHY???
    Here my Servlet code:
    public void doPost(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException{
             ObjectInputStream inputFromApplet = null;
             ArrayList transmitContent = null;       
             PrintWriter out = null;
             BufferedReader inTest = null;
             try{               
                   inputFromApplet = new ObjectInputStream(request.getInputStream());           
                     transmitContent = (ArrayList) inputFromApplet.readObject();       
                     inputFromApplet.close();
                     ArrayList toReturn = new ArrayList();                 
                     toReturn.add("One");
                     toReturn.add("Two");
                     toReturn.add("Three");
                     sendAnsweredList(response, toReturn);                 
             catch(Exception e){}        
         public void sendAnsweredList(HttpServletResponse response, ArrayList returnObject){
             ObjectOutputStream outputToApplet;    
              try{
                  outputToApplet = new ObjectOutputStream(response.getOutputStream());          
                  outputToApplet.writeObject(returnObject);
                  outputToApplet.flush();           
                  outputToApplet.close();              
              catch (IOException e){
                     e.printStackTrace();
    }Here my Applet code:
    public void init() {         
             moreStuff.addActionListener(new ActionListener(){
                  public void actionPerformed(ActionEvent e){
                       requestMore();
             try{
                  studentDBservlet = new URL("http://localhost/DBHandlerServlet");              
                  servletConnection = studentDBservlet.openConnection();      
                   servletConnection.setUseCaches (false);
                   servletConnection.setDefaultUseCaches(false);
                   servletConnection.setDoOutput(true);
                   servletConnection.setDoInput(true);
                   ObjectOutputStream outputToApplet;
                 outputToApplet = new ObjectOutputStream(servletConnection.getOutputStream());          
                 outputToApplet.writeObject(new ArrayList());
                 outputToApplet.flush();           
                 outputToApplet.close(); 
                   ObjectInputStream inputFromServlet = new ObjectInputStream(servletConnection.getInputStream());
                   ArrayList studentVector = (ArrayList) inputFromServlet.readObject();
                   area.setText("Success!\n");
                   for (int i = 0; i<studentVector.size(); i++) {
                        area.append(studentVector.get(i).toString()+"\n");
                  inputFromServlet.close();
                  outputToApplet.close();             
              catch(Exception e){
                   area = new JTextArea();
                   area.setText("An error occured!!!\n");
                   area.append(e.getMessage());
            getContentPane().add(new JScrollPane(area), BorderLayout.CENTER);
            getContentPane().add(moreStuff, BorderLayout.SOUTH);
        private void requestMore(){
             try{              
                  studentDBservlet = new URL("http://localhost/DBHandlerServlet");                             
                  servletConnection = studentDBservlet.openConnection(); 
                   ObjectInputStream inputFromServlet = new ObjectInputStream(servletConnection.getInputStream());
                   ArrayList studentVector = (ArrayList) inputFromServlet.readObject();
                   area.setText("Success2!\n");
                   for (int i = 0; i<studentVector.size(); i++) {
                        area.append(studentVector.get(i).toString()+"\n");
              catch(Exception e){               
                   area.setText("An error occured2!!!\n");
                   area.append(e.getMessage());
        }Can someone help me solv this issue please, this is my first Applet Servlet work so far so I have no idea on how to solve this issue.

    Sorry folks, just found my error. Forgot about the ObjectInputStream waiting on the Servlet side, so of course had a dead look...
    Sorry!

  • Error in retrieving tables / object already exists (UNV0035)

    In XiR2 Designer we are usually able to invoke the table browser without issue, however after working in the app for some time... when invoking the table browser the error msg "Error in retrieving tables / This object already exists. (UNV0035)" pops up.  Then you are still able to open the table browser.  I've seen the same or similar msg when trying to insert or edit derived tables.  As mentioned, usually the table browser functions ok, so the db rights seem in order.  Has anyone else experienced / solved this?
    -Bob

    Hi,
    From the error no unv0035, i came to konw that The object that you are trying to create already exists in the class. Objects must have unique names within the same class.
                              Try to Rename the existing object, or give the new object another name. If you
    change the name of an existing object, documents using this object may not refresh correctly.
    Thanks,
    SK.

Maybe you are looking for