Is it possible in an html to call the objects of a class?

Hi,
Please help me.I have already posted it, but it's very urgent i am in need for an working answer.
I am calling an applet class 2 times in a browser.To share some variable i have declared as private static. But when i call these applets are called in different browsers , still these variables are shared.
Actually i want the applets in one browser to be independent of the other applets in a separate browser. Can anyone help me to solve this problem?
Is it possible in an html to call the objects of a class?
Is there any some workarounds? For instance calling applets in separate JVM in the same machine.Any idea how to do that?
Another option is using something like the session variables. But is that possible in a variable inside the applet class?
Thanks in advance to all the solutions. Hope someone clicks an idea from the above possibilities.

To get a reference to other applets in the same JVM (actually same browser window), do the following:
//get a reference to the other applets in the same browser window
java.applet.AppletContext appCon = yourAppletRef.getAppletContext();
JApplet applet = (JApplet) appCon.getApplet(otherAppletName);or use AppletContext.getApplets() to get an enumeration of all the accessible applets. If you want to use the Session object to store your values, then, in your javascript, make a call to the applet methods. Use JSP expressions for the value of these session String values (i.e. <%= %>) to set the parameters of your applet methods. In a nutshell, it is possible. I hope this helps.

Similar Messages

  • How do i call the method in a class using servlet

    i am doing a project which need to use servlet to call a few methods in a class and display those method on the broswer. i tried to write the servlet myself but there are still some errors .. can anyone help:
    The servlet i wrote :
    package qm.minipas;
    import java.io.*;
    import java.util.*;
    import javax.servlet.*;
    import javax.servlet.http.*;
    public class test extends HttpServlet {
    Database database;
    /** Initializes the servlet.
    public void init(ServletConfig config) throws ServletException {
    super.init(config);
    database = FlatfileDatabase.getInstance();
    /** Destroys the servlet.
    public void destroy() {
    /** Processes requests for both HTTP <code>GET</code> and <code>POST</code> methods.
    * @param request servlet request
    * @param response servlet response
    protected void processRequest(HttpServletRequest request, HttpServletResponse response)
    throws ServletException, java.io.IOException {
    response.setContentType("text/html");
    java.io.PrintWriter out = response.getWriter();
    out.println("<html>");
    out.println("<head>");
    out.println("<title>Servlet</title>");
    out.println("</head>");
    out.println("<body>");
    out.println("this is my class wossname"+FlatfileDatabase.getInstance()); // this is calling the toString() method in the instance of myJavaClass
    out.println("this is my method"+FlatfileDatabase.getAll());
    out.println("</body>");
    out.println("</html>");
    out.close();
    /** Handles the HTTP <code>GET</code> method.
    * @param request servlet request
    * @param response servlet response
    protected void doGet(HttpServletRequest request, HttpServletResponse response)
    throws ServletException, java.io.IOException {
    processRequest(request, response);
    /** Handles the HTTP <code>POST</code> method.
    * @param request servlet request
    * @param response servlet response
    protected void doPost(HttpServletRequest request, HttpServletResponse response)
    throws ServletException, java.io.IOException {
    processRequest(request, response);
    /** Returns a short description of the servlet.
    public String getServletInfo() {
    return "Short description";
    my methods which i need to call are shown below:
    public Collection getAll() {
    return Collections.unmodifiableCollection(patientRecords);
    public Collection getInpatients() {
    Collection selection=new ArrayList();
    synchronized(patientRecords) {
    for(Iterator i=patientRecords.iterator(); i.hasNext();) {
    PatientRecord next=(PatientRecord) i.next();
    if(next.isInpatient())
    selection.add(next);
    return Collections.unmodifiableCollection(selection);
    public Collection getByAdmissionDate(Date dateOfAdmission) {
    List selection=new ArrayList();
    for(Iterator i=patientRecords.iterator(); i.hasNext();) {
    PatientRecord next=(PatientRecord) i.next();
    if(dateOfAdmission.equals(next.getDateOfAdmission()))
    selection.add(next);
    return Collections.unmodifiableCollection(selection);
    public Collection getByAdmissionDates(Date from,Date to)
    throws IllegalArgumentException {
    if(to.before(from))
    throw new IllegalArgumentException("End date must not be before start date");
    List selection=new ArrayList();
    for(Iterator i=patientRecords.iterator(); i.hasNext();) {
    PatientRecord next=(PatientRecord) i.next();
    Date nextAD=next.getDateOfAdmission();
    if((nextAD.after(from)||nextAD.equals(from))
    &&(nextAD.before(to)||nextAD.equals(to)))
    selection.add(next);
    return Collections.unmodifiableCollection(selection);
    public Collection getByDischargeDates(Date from,Date to)
    throws IllegalArgumentException {
    if(to.before(from))
    throw new IllegalArgumentException("End date must not be before start date");
    List selection=new ArrayList();
    for(Iterator i=patientRecords.iterator(); i.hasNext();) {
    PatientRecord next=(PatientRecord) i.next();
    Date nextAD=next.getDateOfDischarge();
    if(nextAD==null)
    continue;
    if((nextAD.after(from)||nextAD.equals(from))
    &&(nextAD.before(to)||nextAD.equals(to)))
    selection.add(next);
    return Collections.unmodifiableCollection(selection);
    public Collection getByConsultant(String consultant) {
    List selection=new ArrayList();
    for(Iterator i=patientRecords.iterator(); i.hasNext();) {
    PatientRecord next=(PatientRecord) i.next();
    if(consultant.equalsIgnoreCase(next.getConsultant()))
    selection.add(next);
    return Collections.unmodifiableCollection(selection);
    public Collection getByDischargeDate(Date dateOfDischarge) {
    List selection=new ArrayList();
    for(Iterator i=patientRecords.iterator(); i.hasNext();) {
    PatientRecord next=(PatientRecord) i.next();
    if(dateOfDischarge.equals(next.getDateOfDischarge()))
    selection.add(next);
    return Collections.unmodifiableCollection(selection);
    public Collection getBySurname(String surname) {
    List selection=new ArrayList();
    for(Iterator i=patientRecords.iterator(); i.hasNext();) {
    PatientRecord next=(PatientRecord) i.next();
    if(surname.equalsIgnoreCase(next.getSurname()))
    selection.add(next);
    return Collections.unmodifiableCollection(selection);
    public Collection getByWard(String ward) {
    List selection=new ArrayList();
    for(Iterator i=patientRecords.iterator(); i.hasNext();) {
    PatientRecord next=(PatientRecord) i.next();
    if(ward.equalsIgnoreCase(next.getWard()))
    selection.add(next);
    return Collections.unmodifiableCollection(selection);

    please provide a detail description of your errors.

  • How to output HTML when called from a browser

    We are trying to replace a small web app with a bpel app so it has to return HTML. I keep getting XML of the HTML as output from this simple app. It doesn't interpret the html. The bpel uses a simple assign that puts an HTML string into the "body" message then passes it to the "reply".
    I have found out how to call this from the browser by changing "orabpel" in the url to "httpbinding" and then adding the "operation" onto the endpoint.
    from: http://server:7777/orabpel/default/ws1/1.0
      to: http://server:7777/httpbinding/default/ws1/processIs it possible to output html back to the browser and have the bpel look like a web page? Setting the mimetype of the output message type to "text/html" seems to have no effect at all.
    Here is my wsdl:
    <?xml version="1.0"?>
    <definitions name="HTTPGetService"
                 targetNamespace="http://services.otn.com"
                 xmlns:tns="http://services.otn.com"
                 xmlns:plnk="http://schemas.xmlsoap.org/ws/2003/05/partner-link/"
                 xmlns="http://schemas.xmlsoap.org/wsdl/"
                 xmlns:xsd="http://www.w3.org/2001/XMLSchema"
                 xmlns:http="http://schemas.xmlsoap.org/wsdl/http/"
                 xmlns:mime="http://schemas.xmlsoap.org/wsdl/mime/">
        <message name="HTTPGetServiceRequestMessage">
            <part name="Region" type="xsd:string"/>
            <part name="EffectiveDate" type="xsd:string"/>
            <part name="EndDate" type="xsd:string"/>
            <part name="acc1" type="xsd:string"/>
            <part name="acc2" type="xsd:string"/>
        </message>
        <message name="HTTPGetServiceResponseMessage">
            <part name="body" type="xsd:string"/>
        </message>
        <!-- portType implemented by the HTTPGetService BPEL process -->
        <portType name="HTTPGetService">
            <operation name="process">
                <input message="tns:HTTPGetServiceRequestMessage"/>
                <output message="tns:HTTPGetServiceResponseMessage"/>
            </operation>
        </portType>
        <binding name="HTTPGet" type="tns:HTTPGetService">
            <http:binding verb="GET"/>
            <operation name="process">
                <http:operation location="/process"/>
                <input>
                    <http:urlEncoded/>
                </input>
                <output>
                    <http:urlEncoded/>
                    <mime:content type="text/html" part="body"/>
                </output>
            </operation>
        </binding>

    Hi,
    Open up admin console. Expand "Servers" node to view servers in domain.
    Right click on a server (or select Logging/ General tab) and select "view
    server log".
    Regards,
    Jon

  • Is it possible to save HTML files to touch memory?

    Is it possible to save html files to the touch memory and view them when not within WiFi range? When traveling I'm more often than not without a WiFi connection. I do NOT want an iPhone nor it's hefty wireless data bill. I simply want to view locally saved HTML files. Is that possible without jailbreaking? Thank you.

    This is a great question. I want to buy a Touch but I won't buy one until I know the answer to this question.
    I went to an Apple store last week and told them I ride the bus to work every day. I said I wanted to download information over my wireless network at home, then view the info while riding the bus to work.
    The guy told me that I could view whatever was in my cache. I don't know how big the cache is. I read through the Itouch user guide and couldn't find any info.
    If someone has some useful experience, it would be very appreciated. If you can use the cache, how many typical web pages can you store?

  • How to call the second mapping in the first mapping fails in the BPM

    Hi All,
    I have a scenario like this.
    There are two mappings. There is a one condition while genearying the root element of the first mapping. If this condition is not satisfies the first mapping will fail. If this mapping fails i want to trigger another mapping.
    How to achieve this functionality.
    If it is possible with BPM. how to call the second mapping in the BPM.

    Hi
    you can not create the containter for the synchronous interfaces.
    you have to craete the two asysnchronous abstact interfaces .
    thenusing those two abstract interfaces you have to define the containers in the BPM.
    and you also have to define the interface mapping b/w those two abstract interfaces.
    once you define the interface mapping you will be able to select the interface mapping using the transformation step in BPM.
    once you select the interface mapping in BPM then you will be able to selece the interfaces
    if you still face the problenm please reply me back.
    Thanks
    Rinku Gangwnau

  • How to call the bean in jspdyn component?

    Hi,
    i created  jspdyn component in that bean and bussiness logic class in NWDS.i created a method() in that businesslogic class.i called that method in bean class.i created both in same package,there is no error occur while creating the object of that class.but the bean class not recognize the business class method which i created. What is the cause? and also tell me how to call the bean in jsppage also.and also give me textfields,button and syntax of event handling in HTMLB,iam new to this area.so,give me one example step by step.

    Hi,
         Please check on these links for a good start.
    Java development methodologies (Part II)
    Bean usage in JSPDynPage
    jspDynPage portalapp.xml
    Regards,
    Harini S
    Please avoid giving personal mail id(s). That may prevent others from getting the same information when needed.

  • How to call a method of a class where the name of method is string

    i have a method of a class in the form of a string and i have the object of the class to which it belongs .what i want to do is call this method.
    for ex:
    S1 s=new S1();
    // this is the object of my class. this class has one method called executeMe()
    String methodname="executeMe";
    //i have the name of the method with me in the form of string.
    so how can i call the class's method in this scenario from the string like what should i write in sucha way that i get s.executeMe(); it is not presumed that this will only be the method that will be called. there maybe some other method too and it has also to be called this way. so please guide.

    S1 s = new S1();
    String name = "executeMe";
    Method m = s.getClass().getDeclaredMethod(name,null); // no parameters
    m.invoke(s,null);Built from memory, maycontain flaws.

  • Calling another object's method

    I have made a GUI in swing.
    I have a class object with all my database methods in it.
    I am having problems calling a particular method in my Database Object and displaying the ResultSet of that method in my Swing GUI.
    here is the code from the GUI calling the object:
    public void displayUAI() {
         String course2, Min2, Rev2; //the object types to be sent
         int num1, num2;
         Min2 = newUAI2.getText();
         Rev2 = newRevUAI2.getText();
         num1 = Integer.parseInt(Min2);
         num2 = Integer.parseInt(Rev2);
         course2 = (String)Course.getSelectedItem();
         DataBaseTools.displayUAI(num1, num2, course2); //the database object method that i'm trying to call
    //The following 2 lines are what i would like to happen after i invoke the method in the database object; i would like to update these two textfields with the database results found
         newUAI2.setText(Min2);
         newRevUAI2.setText(Rev2);
    }//end displayUAI()*/
    This is the code for the method in the Database-class object:
         public static void displayUAI(int min, int rev, String Course){
              try {
              Class.forName("sun.jdbc.odbc.JdbcOdbcDriver");
              database+= filename.trim() + IDnState; // add on to the end
              Connection con = DriverManager.getConnection( database ,"","");
              String query = "SELECT * FROM Course where Name= ('" + Course +"')";
              Statement stmt = con.createStatement();
                             // Create a result set containing all data from my_table
                                  ResultSet rs = stmt.executeQuery(query);
                                  //System.out.println("Athlete DB being updated...:");
                                  while (rs.next()) {
                                       String mina, reva;
                                       mina = rs.getString("Min");
                                       reva = rs.getString("Rev");
                                       min = Integer.parseInt(mina);
                                       rev = Integer.parseInt(reva);
                             stmt.close();
                             con.close();
                        } catch(Exception ex) {
                             System.err.println("SQLException: " + ex.getMessage());
    }//end displayUAI()
    Basically i just want the method to be invoked and the results shown in my SWING GUI.
    Your help would be greatly appreciated.
    Cheers.

    Hi,
    just pass a reference to each of your two textfields in your DB method call... like:
       //In the calling class
       DataBaseTools.displayUAI(num1, num2, course2, newUAI2, newRevUAI2);
       //In the DatabaseTools class
       public static void displayUAI(int min, int rev, String Course, JTextField txtmin, JTextField txtrev){
          mina = rs.getString("Min");
          reva = rs.getString("Rev");
          min = Integer.parseInt(mina);
          rev = Integer.parseInt(reva);
          txtmin.setText(Min2);
          txtrev.setText(Rev2);
       }That should do the trick,
    Regards.

  • How to set a cookie in the browser from an html page called via an Iview

    How to set a cookie in the browser from an html page called via an Iview
    Hello all,
    I have an issue which is causing problems. I have a snap survey (html form with submit and cookie setting) which is embedded in a url iview.
    Although the submit and the form work fine, the portal will not allow the cookie to be set it seems.
    Is there a way to allow cookies to be set from an embedded page in a url iview??
    You will make my day if you know!
    System: EP7 SP13
    Kind regards
    Alex

    Hi,
    Check this:
    http://www.oracle.com/technology/products/ias/portal/html/same_cookie_domain_with_pdkv2.html
    Cookie Basics
    Web browsers have built in rules for receiving and sending cookies. When a browser makes a request to a web server and the web server returns cookies with the response, the browser will only accept a cookie if the domain associated with the cookie matches that of the original request. Similarly, when a browser makes a subsequent request, it will only send those cookies whose domain matches that of the target web server.
    These rules are designed to ensure that information encoded in cookies is only "seen" by the web server(s) that the originator of the cookie intended. These rules also ensure that the cookie cannot be corrupted or imitated by another server. By default, the domain associated with a cookie exactly matches that of the server that created it. However, it is possible to modify the domain at the time the cookie is created. Relaxing the cookie domain increases the scope of the cookie's visibility making it available to a wider "audience" of web servers.
    For example, if a cookie is created by a.us.oracle.com, it's domain will usually be set to a.us.oracle.com. This means that the browser will only send the cookie to a.us.oracle.com. It will never send it to any other servers. However, if at the time of creation, the domain of the cookie is set to .us.oracle.com, the browser will send the cookie to any server whose domain falls within .us.oracle.com. such as portal.us.oracle.com, provider.us.oracle.com, app.us.oracle.com etc
    Regards,
    Praveen Gudapati

  • Possible to parse HTML in TextArea?

    Hi All,
    I'd like to know whether it is possible to display HTML code in textarea when we use webui page. We have a table column with HTML code in it(something like &lt;font style="..."&gt;, &lt;span style="background:xxxx"&gt;, &lt;a href=""&gt; and so on), and we want to parse them as normal html page does in our overview page. I tried to define the attribute node as textarea in the GET_P method but it displays all HTML source code without any conversion, that's not I want. As I'm new to WEBUI, it's really tough for me. But, as the saying said, Nothing is impossible, so I'm sure it has solutions. Could you please help me figure out?
    Thank you very much!
    Jeff

    first of all you need to get the remote resource ( html file) as an input stream
    URL url = new URL("http://forums.sun.com");
    HttpURLConnection con = (HttpURLConnection) url.openConnection();
    // get the InputStream = con.getInputStream()
    second find a parser to parse the inputStream and give you call back with the startElement, endElement, etc..
    implement you interest in what call back method you want. Just search for an html parser and there will be an example associated to it
    Regards,
    Alan Mehio
    London,UK

  • Is it possible to call the Print Quote functionality from Custom ADF page

    Hi,
    We are researching if it is possible to call the Print Quote functionality from the Custom ADF application.
    Goal is to pop up the PDF report upon clicking the Print Quote button on the custom page. Is it possible ?
    Atleast advice on the direction to go forward is appreciated.
    Thanks
    Sai

    Hi ,
    Please check following thread on forum -
    Re: ADF: Calling OAF Page from ADF page
    Check this may also be useful-
    https://blogs.oracle.com/shay/entry/to_adf_or_oaf_or
    I have not tried yet but Steven Chan (Sr. Director OATG) suggest following methodolgy for this-
    https://blogs.oracle.com/stevenChan/entry/appsdatasource_jaas_ebs
    Thanks,
    Ashish

  • Is it possible to call the contact number indicated in the cell?

    Hello! Tell me please, I want to move a lot of contacts in the electronic form and organize a list of contacts in Numbers. Is it convenient to use it on the iphone? Is it possible to call the contact number indicated in the cell? That is an example: name, contact, etc. A few columns. I click on the number of human cell, and then what would happen if a set of user (as it happens in the notes for example)?
    Sorry for my english.

    Your post is now in the iWork for iOS community. You should be able to get to it using the link in the email you receive with this message.
    Regards,
    Barry
    PS: Interesting that I received the notification of your post in Russian (except for the first and last words).
    Here's Googles translation of my reply above:
    Ваше сообщение в настоящее время в IWORK для IOS сообщества. Вы должны быть в состоянии добраться до него по ссылке в сообщении электронной почты вы получите с этим сообщением.
    С уважением,
    Барри

  • Is it possible to accept an incomming call automatically?

    I am using my iPhone 4 or 5 while driving a car. Is it possible to accept an incomming call automatically?

    No

  • Is it possible to import html files and export them as scorm?

    Hi,
    is it possible to import html files (like a website) and export them as a SCORM compatible ZIP file?
    Thanks!

    You can embed html pages in a Captivate slide and they are included in the SCORM zip file when you publish, is this what you mean?

  • How to call methods defined in another class ? is it possible?

    Hi all,
    I am new to using JNI, was wondering if this is possible and how I might be able to do this. I'm trying to call some set/get functions defined in a class that is not part of the class where I have my native code defined and called...
    Let me explain a bit, I have a class JobElement (singular Job) that stores all the data associated with a Job, such as job name, job id, etc.
    Another class JobsElement (plural Jobs) contains all the Jobs that are currently running.
    The code is set up something like this...
    class JobElement {
         String jobID;
         String jobName;
         public void setJobId(String newJobID) { jobID = newJobID; }
         public void setJobName(String newJobName) { jobName = newJobName; }
    class JobsElement {
         Date timeDateStamp;
         JobElement job;
    class AppRoot {
         JobsElement allJobs = null;
         JobElement _currentJob = null;
         public native getAllJobs();
    }In my native method, getAllJobs(), I essentially want to call the set functions that are defined for JobElement when filling in the information of the Job. (then finally add the JobElement to the JobsElement list)
    In summary, I basically want to know if it's possible to call the equivilent of this java code from the native code??
         _currentJob.setJobName(newJob)
    In the native code I tried to find the setJobID method but got a NoSuchMethodError. (which is what I expected)
    Thanks in advance.

    Hi,
    In your getAllJobs(), the JNI Equiv would be JNIEnv_ClassName_getAllJobs(JNIEnv** anEnv, jobject jAppRootobj)
    Since you are calling the AppRoot object's method, the jobj in the native method call will be jAppRootobj-AppRoot's instance.
    What you can do is
    Get the field id of _currentJob.
    Get the <jobject-value of currentJob> of JobElement i.e. currentJob.
    Then get the method ids of setJobID and setJobName.
    Call these non-static methods on <jobject-value of _currentJob> to set the values.
    I hope I made a try to help you. Please correct me if I am wrong.

Maybe you are looking for

  • How to get back contacts and correct Gmail address and account

    Spoke on the phone with a support tech to fix a problem.   Eventually he cleared out a lot of info.  He said any info that was not saved is what would be eliminated.    That seemed to include all of my contacts.  And I had to restart my Gmail. And my

  • Minimum Development Landscape for XI

    Hello, In most cases the proposed optimum landscape for an XI project is the following: 2 XI servers such that    DEV R/3 linked via logical name to XI DEV and    PRD R/3 linked via logical name to XI PRD) Asking the customer to buy 2 servers for XI

  • BW and EP Integration using SNEAK ABAP & JAVA

    Hi, I have NetWeaver 2004s - ABAP (SP6) installed along with NetWeaver 2004 - JAVA (SP15). Is it possible to execute a BI query in the web browser using these sneak versions. I get an error that an iView is missing - com.sap.ip.bi.bex I have read a f

  • Tween doesn't stop

    Hello My problem is that I have a movieclip that initiates a function when clicked. This function contains if-statements to find out if the movieclip has been pressed before. I then uses w.stop(); to stop a tween started before, but i doesn't work! I

  • Issue on search help

    In my module pool screen I have Shipment Number(vttk-tknum) field along with Shipment Item(vttp-tpnum). Now I have created custom search help for Shipment item (TPNUM). Now the search help for Item should function like: what Shipment no I have select