Accessing a public method from javascript in an applet!!!

Hi!!
I'm have an applet (named say applet.class) in an html page that has a public method like this....
public void doShowFrame()
          Frame frame = new frame();
     frame.setVisible (true);
What I want to do is to call that method with javascript, I've tried to do it like this...
function show(){
applet.doShowFrame();
But when i press the button that launch the java scipt the browser says
'applet' is unidentified...
What's wrong, what can I do??

http://www.google.com/search?q=applet+javascript+communication&sourceid=opera&num=0&ie=utf-8&oe=utf-8
how hard was that? seriously.

Similar Messages

  • Accessing a japplet method from javascript using plugin

    Hi,
    I am currently trying to invoke a public method coded in a swing applet from my javascript.
    As per the documentation and discussion at this site,tried to workaround by using document.AppletName.MethodName.
    I am using Javaplugin 1.2.2 and an Object tag (not an applet tag)
    I am getting "object not found' error on running it.
    Any possible suggestions as to why its happening?

    part of my javascript code is pasted below.
    I tried using applet tag instaed just in case but keep gettin the same message.'Not an object"
    </HEAD>
    <BODY onload ="setUserName()">
    <SCRIPT LANGUAGE="javascript">
    function setUserName(){
    var str = document.location.search;
    document.write(str)
    var query = str.charAt(0) == '?' ? str.substring(1) : str;
    document.write(query)
    -----> document.BApplet.setUser(query);
    </script>
    BApplet will appear below in a Java enabled browser.<BR>
    <OBJECT id="BApplet" classid="clsid:8AD9C840-044E-11D1-B3E9-00805F499D93"
    WIDTH = 100
              HEIGHT = 100
              ALIGN = middle
              VSPACE = 0
              HSPACE = 0
              codebase="http://java.sun.com/products/plugin/1.2.2/jinstall-1_2_2-win.cab#Version=1,2,2,0">
    <PARAM NAME = CODE VALUE = "com.common.BApplet.class" >
    <PARAM NAME = CODEBASE VALUE = "./lib" >
    <comment>
    <embed>
    </embed>
    </comment>
    </object>
    </body>
    </html>

  • How to access the controller method from javascript onclick event?

    Hi All,
       I am totally new to development. And I got struck in calling a controller method from javascript function.
       I have no idea about ajax and all those things. Please can anyone help me to solve this issue!
    Thanks in advance.

    Hi,
    As I know, you can use jQuery to do this, here is an example.
    Example of your Controller Method.
    [HttpPost] // can be HttpGet
    public ActionResult Test(string id)
    bool isValid = yourcheckmethod(); //.. check
    var obj = new {
    valid = isValid
    return Json(obj);
    and this would be your javascript function.
    function checkValidId(checkId)
    $.ajax({
    url: 'controllerName/Test',
    type: 'POST',
    contentType: 'application/json;',
    data: JSON.stringify({ id: checkId }),
    success: function (valid)
    if(valid) { //show that id is valid }
    else { //show that id is not valid }
    If you have further issues, I would suggest you move to MVC forum, it is appropriate and more experts will assist you.
    Best Regards,
    Jambor
    We are trying to better understand customer views on social support experience, so your participation in this interview project would be greatly appreciated if you have time. Thanks for helping make community forums a great place.
    Click
    HERE to participate the survey.

  • Error while accessing a public method of applet from javascript.

    Hi,
    I am getting "Object doesn't support this property or method" error
    when accessing a public method of applet from javascript in IE 6 using
    document.applets[0].myMethod();
    The same is working in IE 7.
    Thanks in advance.
    Regards,
    Phanikanth

    I don't know why it happens, but this works for me in both versions:
    <applet ..... name="MyApplet">
    </applet>and in javascript use
    document.MyApplet.myMethod()

  • Accessing public JApplet method from javascript

    Hi,
    I am currently trying to invoke a public method coded in a swing applet from my javascript.
    As per the documentation and discussion at this site,tried to workaround by using document.AppletName.MethodName.
    I am using Javaplugin 1.2.2 and an Object tag (not an applet tag)
    I am getting "object not found' error on running it.
    Any possible suggestions as to why its happening?

    Hi,
    You have to set the scriptable property to true in the object tag. I have included a sample object tag here below. Just change the applet name and applet class name. It has surely worked for me.For more details mail me : [email protected]
    <OBJECT classid="clsid:E19F9330-3110-11d4-991C-005004D3B3DB" name="AppletName");
    WIDTH ="200" HEIGHT ="250" codebase="http://java.sun.com/products/plugin/1.3.0_01/jinstall-130_01-win32.cab#Version=1,3,0,1"
    <PARAM NAME = CODE VALUE = AppletName.class ><PARAM NAME="type" VALUE="application/x-java-applet;jpi-version=1.3.0_01">
    <PARAM NAME="scriptable" VALUE="true">
    <EMBED type="application/x-java-applet;jpi-version=1.3.0_01" name="AppletName" CODE = AppletName.class WIDTH ="200" HEIGHT ="250" scriptable=true pluginspage="http://java.sun.com/products/plugin/1.3.0_01/plugin-install.html">
    <NOEMBED></EMBED></OBJECT>

  • How to call jpf controller method from javascript

    Can any one help me how to call pageflow controller method from JavaScript.\
    Thanks.

    Accessing a particular pageflow method from Javascript is directly not possible unless we do some real funky coding in specifying document.myForm.action = xyz...Heres what I tried and it did not work as expected: I found another workaround that I will share with you.
    1. In my jsp file when I click a button a call a JavaScript that calls the method that I want in pageflow like this: My method got invoked BUT when that method forwards the jsp, it lost the portal context. I saw my returned jsp only on the browser instead of seeing it inside the portlet on the page of a portal. I just see contents of jsp on full browser screen. I checked the url. This does make the sense. I do not see the url where I will have like test1.portal?_pageLabe=xxx&portlet details etc etc. So this bottom approach will notwork.
    document.getElementById("batchForm").action = "/portlets/com/hid/iod/Batches/holdBatch"; // here if you give like test1.portal/pagelable value like complete url...it may work...but not suggested/recommended....
    document.getElementById("batchForm").submit;
    2. I achieved my requirement using a hidden variable inside my netui:form tag in the jsp. Say for example, I have 3 buttons and all of them should call their own action methods like create, update, delete on pageflow side. But I want these to be called through javascript say for example to do some validation. (I have diff usecase though). So I created a hidden field like ACTION_NAME. I have 3 javascript functions create(), update() etc. These javascripts are called onclick() for these buttons. In thse functions first I set unique value to this hiddent field appropriately. Then submit the form. Note that all 3 buttons now go to same common action in the JPF. The code is like this.
    document.getElementById("ACTION_NAME").value = "UPDATE";
    document.getElementById("batchForm").submit.
    Inside the pageflow common method, I retriev this hidden field value and based on its value, I call one of the above 3 methods in pageflow. This works for me. There may be better solution.
    3. Another usecase that I want to share and may be help others also. Most of the time very common usecase is, when we select a item in a drop bos or netui:select, we want to invoke the pageflow action. Say we have 2 dropdown boxes with States and Cities. Anytime States select box is changed, it should go back to server and get new list of Cities for that state. (We can get both states and cities and do all string tokenizer on jsp itself. But inreality as per business needs, we do have to go to server to get dynamic values. Here is the code snippet that I use and it works for all my select boxes onChange event.
    This entire lines of code should do what we want.
    <netui:anchor action="selectArticleChanged" formSubmit="true" tagId="selectPropertyAction"/>                    
    <netui:select onChange="document.getElementById(lookupIdByTagId('selectPropertyAction',this )).onclick();" dataSource="pageFlow.selectedArticleId" >
    <c:forEach items="${requestScope.ALL_ARTICLE}" var="eachArticle">
    <%-- workshop:varType="com.hid.iod.forms.IoDProfileArticleRelForm" --%>
    <netui:selectOption value="${eachArticle.articleIdAsString}">${eachArticle.articleItemName}</netui:selectOption>
    </c:forEach>               
    </netui:select>
    See if you can build along those above lines of code. Any other simpler approches are highly welcome.
    Thanks
    Ravi Jegga

  • Call Java method from JavaScript

    Hi,
    I have a Java class called abc.java and in that I have a method called assignValue(String value).
    I need to call this method, assignValue() , from JavaScript.
    Is there a way to call a Java method from JavaScript.
    Any help is greatly appreciated.
    Thanks.

    Yes I did, and I still don't get it, I have created a JSF web application, not an applet, as I posted earlier my code to executes sit's in a class file, not an applet file.
    My Page1.class file is as follows
    * Page1.java
    package a1;
    import ....
    public class Page1 extends AbstractPageBean {
        public void valset(int val) {
    }my jsp file "Page1.jsp" is as follows:
    <?xml version="1.0" encoding="UTF-8"?>
    <jsp:root version="1.2" xmlns:f="http://java.sun.com/jsf/core" xmlns:h="http://java.sun.com/jsf/html" xmlns:jsp="http://java.sun.com/JSP/Page" xmlns:ui="http://www.sun.com/web/ui">
        <jsp:directive.page contentType="text/html;charset=UTF-8" pageEncoding="UTF-8"/>
        <f:view>
            <ui:page binding="#{Page1.page1}" id="page1">
                <ui:html binding="#{Page1.html1}" id="html1">
                    <ui:head binding="#{Page1.head1}" id="head1">
                        <ui:link binding="#{Page1.link1}" id="link1" url="/resources/stylesheet.css"/>
                    </ui:head>
                    <ui:body binding="#{Page1.body1}" id="body1" style="-rave-layout: grid">
                        <ui:form binding="#{Page1.form1}" id="form1">
    <applet code="Page1.class" name="Page1" width="1100" height="600">
                    </applet>
                            <ui:button action="#{Page1.button1_action}" binding="#{Page1.button1}" id="button1" onMouseOver="form1.Page1.valset(1);"
                                style="left: 239px; top: 192px; position: absolute" text="Button"/>
    </ui:form>
                    </ui:body>
                </ui:html>
            </ui:page>
        </f:view>
    </jsp:root>All I get is a grey box the size of the applet window. Could you please let me know what I'm doing wrong?

  • How to call a bean method from javascript event

    Hi,
    I could not find material on how to call a bean method from javascript, any help would be appreciated.
    Ralph

    Hi,
    Basically, I would like to call a method that I have written in the page java bean, or in the session bean, or application bean, or an external bean, from the javascript events (mouseover, on click, etc...) of a ui jsf component. I.e., I would like to take an action when a user clicks in a column in a datatable.
    Cheers,
    Ralph

  • Invoking Applet methods from Javascript for Netscape 6

    Hi,
    I am trying to invoke an applet method from javascript, but it is failing with Netscape 6 browser:
    I am doing it the following way-
    function test(form)
    var i = document.myapplet.getname();
    where myapplet is the name of the applet and getname is a method within the applet. This is
    working with Ie but not with netscape 6.
    I would appreciate it if someone could tell me how should I invoke the applet method for netscape browsers.
    Thanks.
    Jay Srin.

    Not working with NS 6 - and will not i guess till they upgrade to Mozilla Version 1.0 - Live Connect is not implemented 100% correct yet - if you want you can download the 7.0 Pre Release Netscape - since its using mozilla 1.0 it should work , see :
    http://forum.java.sun.com/thread.jsp?forum=30&thread=272975

  • Accessing Signed Applet Method From Javascript

    Hi All,
    In my intranet application i have to retrive the mac addres of the client using the applet. I have to capture the MAC Address and set it as a hidden value in the jsp page.
    I have used the signed applet and able to retrive the mac address of the client using IE but I am not able to do the same on NN 7.1
    Below is my javascript and the applet tag syntax, please help me if i am wrong anywhere
    function mac()
    var mval=document.myApplet.getWinMACAddress()
    alert("addres" +mval)                         
    document.loginform.js_value.value=mval
    and the applet tag in my jsp page is
    <applet code ="SignedAppletDemo.class" codebase="http://mysouthasia/AcadResource/jsp/" archive="SSignedApplet.jar" width=1 height=1 align=center name="myApplet" >
    </applet>
    Thanks in Advance

    Since getWinMACAddress( ) seems to work just fine for IE, is there an equivalent for NN7.1?
    What happens if I run Opera instead, and on a Linux system? Or Safari on OS X? Obviously getWinMACAddress( ) isn't going to work for that.
    I really don't understand why so many Asian programmers get "Find the MAC address of..." as a homework assignment. There are many reasons why it isn't really practical to do so, and for examples, just search this forum for MAC addresses. Lots and lots of examples and counter examples.

  • Access af:table values from JavaScript array (for google maps task)

    Hi!
    I have JSP page with af:table where latitude and longitude for google maps are stored. I am using these tutorial [https://blogs.oracle.com/middleware/entry/integrating_google_maps_with_adf] and I know how to access latitude and longitude from output text (for one point). Now i need to do something similar with loop for all table rows. How can I achieve this?
    I have JavaScript code which uses Google Maps API and can display many points on one map. Also I have longitude and latitude data in af:table (bindings), each table row has one point. My task is to take data from af:table and pass it to JavaScript.
    May be it is better to use managed bean as you said. Firstly I will access binding data from managed bean. Then I have to pass this data to JavaScript method? Can you suggest some example? I have "Using JavaScript in ADF Faces Rich Client Applications"

    My table is there :
    <af:table value="#{bindings.LocView1.collectionModel}" var="row"
                                  rows="#{bindings.LocView1.rangeSize}"
                                  emptyText="#{bindings.LocView1.viewable ? 'No data to display.' : 'Access Denied.'}"
                                  fetchSize="#{bindings.LocView1.rangeSize}" rowBandingInterval="0"
                                  filterModel="#{bindings.LocView1Query.queryDescriptor}"
                                  queryListener="#{bindings.LocView1Query.processQuery}" filterVisible="true" varStatus="vs"
                                  selectedRowKeys="#{bindings.LocView1.collectionModel.selectedRow}"
                                  selectionListener="#{bindings.LocView1.collectionModel.makeCurrent}" rowSelection="single"
                                  id="t1">
                            <af:column sortProperty="#{bindings.LocView1.hints.SoffOffCode.name}" filterable="true"
                                       sortable="true" headerText="#{bindings.LocView1.hints.SoffOffCode.label}" id="c1">
                                <af:outputText value="#{row.SoffOffCode}" clientComponent="true" id="ot1"/>
                            </af:column>
                            <af:column sortProperty="#{bindings.LocView1.hints.SoffCode.name}" filterable="true"
                                       sortable="true" headerText="#{bindings.LocView1.hints.SoffCode.label}" id="c2">
                                <af:outputText value="#{row.SoffCode}" id="ot2"/>
                            </af:column>
                            <af:column sortProperty="#{bindings.LocView1.hints.SoffLat.name}" filterable="true"
                                       sortable="true" headerText="#{bindings.LocView1.hints.SoffLat.label}" id="c3">
                                <af:outputText value="#{row.SoffLat}" clientComponent="true" id="ot3"/>
                            </af:column>
                            <af:column clientComponent="true" sortProperty="#{bindings.LocView1.hints.SoffLng.name}" filterable="true"
                                       sortable="true" headerText="#{bindings.LocView1.hints.SoffLng.label}" id="c4">
                                <af:outputText value="#{row.SoffLng}" clientComponent="true" id="ot4"/>
                            </af:column>
                            <af:column sortProperty="#{bindings.LocView1.hints.SoffZoom.name}" filterable="true"
                                       sortable="true" headerText="#{bindings.LocView1.hints.SoffZoom.label}" id="c5">
                                <af:outputText value="#{row.SoffZoom}" id="ot5"/>
                            </af:column>
                        </af:table>
    Javascript code:
    alert(document.getElementById("t1"));
    Result:
    [object HTMLDivElement];
    And
    alert(document.getElementById("t1").innerHTML);
    Result:
    <div id="t1::ch" style="overflow: hidden; position: relative; width: 366px;" _afrcolcount="5" class="xzg"><table class="xzi" summary="This table contains column headers corresponding to the data body table below" id="t1::ch::t" style="position:relative;table-layout:fixed;width:525px" cellspacing="0"><tbody><tr><th style="padding:0px;padding-left:5px;width:100px;"></th><th style="padding:0px;padding-left:5px;width:100px;"></th><th style="padding:0px;padding-left:5px;width:100px;"></th><th style="padding:0px;padding-left:5px;width:100px;"></th><th style="padding:0px;padding-left:5px;width:100px;"></th></tr><tr><th _d_index="0" _afrfiltercol="true" class="xzr" align="left" nowrap="nowrap"><span id="t1:_afrFltrc1" class="x1u"><input id="t1:_afrFltrc1::content" name="t1:_afrFltrc1" class="x25" type="text"></span></th><th _d_index="1" _afrfiltercol="true" class="xzr" align="left" nowrap="nowrap"><span id="t1:_afrFltrc2" class="x1u"><input id="t1:_afrFltrc2::content" name="t1:_afrFltrc2" class="x25" type="text"></span></th><th _d_index="2" _afrfiltercol="true" class="xzr" align="left" nowrap="nowrap"><span id="t1:_afrFltrc3" class="x1u"><input id="t1:_afrFltrc3::content" name="t1:_afrFltrc3" class="x25" type="text"></span></th><th _d_index="3" _afrfiltercol="true" class="xzr" align="left" nowrap="nowrap"><span id="t1:_afrFltrc4" class="x1u"><input id="t1:_afrFltrc4::content" name="t1:_afrFltrc4" class="x25" type="text"></span></th><th _d_index="4" _afrfiltercol="true" class="xzr" align="left" nowrap="nowrap"><span id="t1:_afrFltrc5" class="x1u"><input id="t1:_afrFltrc5::content" name="t1:_afrFltrc5" class="x25" type="text"></span></th></tr><tr><th id="t1:c1" _d_index="0" _afrleaf="true" _afrroot="true" class="xzj" align="left"><div style="position:relative; float:right"><table id="t1:c1::afrSI" _afrhoverable="true" style="display:none" class="x104" cellpadding="0" cellspacing="0"><tbody><tr><td _afrsortasc="1"><a tabindex="-1" class="xzm" title="Sort Ascending"></a></td><td _afrsortdesc="1"><a tabindex="-1" class="xzn" title="Sort Descending"></a></td></tr></tbody></table></div><div class="x19p">SoffOffCode</div></th><th id="t1:c2" _d_index="1" _afrleaf="true" _afrroot="true" class="xzj" align="left"><div style="position:relative; float:right"><table id="t1:c2::afrSI" _afrhoverable="true" style="display:none" class="x104" cellpadding="0" cellspacing="0"><tbody><tr><td _afrsortasc="1"><a tabindex="-1" class="xzm" title="Sort Ascending"></a></td><td _afrsortdesc="1"><a tabindex="-1" class="xzn" title="Sort Descending"></a></td></tr></tbody></table></div><div class="x19p">SoffCode</div></th><th id="t1:c3" _d_index="2" _afrleaf="true" _afrroot="true" class="xzj" align="left"><div style="position:relative; float:right"><table id="t1:c3::afrSI" _afrhoverable="true" style="display:none" class="x104" cellpadding="0" cellspacing="0"><tbody><tr><td _afrsortasc="1"><a tabindex="-1" class="xzm" title="Sort Ascending"></a></td><td _afrsortdesc="1"><a tabindex="-1" class="xzn" title="Sort Descending"></a></td></tr></tbody></table></div><div class="x19p">SoffLat</div></th><th id="t1:c4" _d_index="3" _afrleaf="true" _afrroot="true" class="xzj" align="left"><div style="position:relative; float:right"><table id="t1:c4::afrSI" _afrhoverable="true" style="display:none" class="x104" cellpadding="0" cellspacing="0"><tbody><tr><td _afrsortasc="1"><a tabindex="-1" class="xzm" title="Sort Ascending"></a></td><td _afrsortdesc="1"><a tabindex="-1" class="xzn" title="Sort Descending"></a></td></tr></tbody></table></div><div class="x19p">SoffLng</div></th><th id="t1:c5" _d_index="4" _afrleaf="true" _afrroot="true" class="xzj" align="left"><div style="position:relative; float:right"><table id="t1:c5::afrSI" _afrhoverable="true" style="display:none" class="x104" cellpadding="0" cellspacing="0"><tbody><tr><td _afrsortasc="1"><a tabindex="-1" class="xzm" title="Sort Ascending"></a></td><td _afrsortdesc="1"><a tabindex="-1" class="xzn" title="Sort Descending"></a></td></tr></tbody></table></div><div class="x19p">SoffZoom</div></th></tr></tbody></table></div><div id="t1::db" class="xz9" style="position: relative; width: 366px; overflow: hidden; height: 521px; z-index: 1;" _afrcolcount="5"><table class="xza x102" style="table-layout:fixed;position:relative;width:525px;" _totalwidth="525" _selstate="{'0':true}" _rowcount="179" _startrow="0" cellspacing="0"><tbody><tr _afrrk="0" class="xzy p_AFSelected"><td style="width:100px;" class="xzv" nowrap="nowrap"><span id="t1:0:ot1">26</span></td><td style="width:100px;" class="xzv" nowrap="nowrap">01</td><td style="width:100px;" class="xzv" nowrap="nowrap"><span id="t1:0:ot3">47.90782714384932</span></td><td style="width:100px;" class="xzv" nowrap="nowrap"><span id="t1:0:ot4">106.88643654861448</span></td><td style="width:100px;" class="xzv" nowrap="nowrap">15</td></tr><tr _afrrk="1" class="xzy"><td class="xzv" nowrap="nowrap"><span id="t1:1:ot1">26</span></td><td class="xzv" nowrap="nowrap">02</td><td class="xzv" nowrap="nowrap"><span id="t1:1:ot3">47.91542113773543</span></td><td class="xzv" nowrap="nowrap"><span id="t1:1:ot4">106.88540658035276</span></td><td class="xzv" nowrap="nowrap">15</td></tr><tr _afrrk="2" class="xzy"><td class="xzv" nowrap="nowrap"><span id="t1:2:ot1">26</span></td><td class="xzv" nowrap="nowrap">03</td><td class="xzv" nowrap="nowrap"><span id="t1:2:ot3">47.90768330745696</span></td><td class="xzv" nowrap="nowrap"><span id="t1:2:ot4">106.89544877090452</span></td><td class="xzv" nowrap="nowrap">15</td></tr><tr _afrrk="3" class="xzy"><td class="xzv" nowrap="nowrap"><span id="t1:3:ot1">26</span></td><td class="xzv" nowrap="nowrap">04</td><td class="xzv" nowrap="nowrap"><span id="t1:3:ot3">47.90716549312801</span></td><td class="xzv" nowrap="nowrap"><span id="t1:3:ot4">106.86879834213255</span></td><td class="xzv" nowrap="nowrap">14</td></tr><tr _afrrk="4" class="xzy"><td class="xzv" nowrap="nowrap"><span id="t1:4:ot1">26</span></td><td class="xzv" nowrap="nowrap">05</td><td class="xzv" nowrap="nowrap"><span id="t1:4:ot3">47.89841940184846</span></td><td class="xzv" nowrap="nowrap"><span id="t1:4:ot4">106.82674130477903</span></td><td class="xzv" nowrap="nowrap">13</td></tr><tr _afrrk="5" class="xzy"><td class="xzv" nowrap="nowrap"><span id="t1:5:ot1">26</span></td><td class="xzv" nowrap="nowrap">06</td><td class="xzv
    .etc
    Javascript:  alert(document.getElementById("t1:121:ot3").innerHTML); this retrieve in value
    But only 50 rows in this result. I have many rows. How I can get all???

  • Accessing a public array from extra class.

    I am trying to access a public array that I declared in my main class from a separate class. I am a bit confused about why this is not working.
    The method search in the extra class is called in the extra class in part one of the nextKeystream method. How can I get it to use the int array "key". That I declared in the MainSolitaireDriver?
    Thanks
    My main class:
    import java.util.*;
    import java.io.*;
    import java.util.Scanner;
    public class MainSolitaireDriver
       int pcount = 0;
       public int[] key = new int[26];    
       public MainSolitaireDriver()
           getValues();
            public void getValues()
                try
                    Scanner inFile = new  Scanner(new File("input.txt"));
                    for (int counter = 0; counter < key.length; counter++ )
                        key[counter]= inFile.nextInt();
                        System.out.print(key[counter]+" ");
                catch(FileNotFoundException e )
                e.printStackTrace();
                System.err.print("Failure- File Not Found");
         public static void main (String[] args)
                /*String whereInTheWorldMyFileShouldBe = new File("input.txt").getAbsolutePath();
    System.out.println(whereInTheWorldMyFileShouldBe); */
    }My extra class:
    public class Solitaire
         private Deck deck;
         *  Initialize the deck from the current key deck ordering.
         public Solitaire (int[] shuffle)
              deck = new Deck(shuffle);
            public void getArray(int[] Array)
            public int search(int [] span, int target)
                for (int indexcount = 0; indexcount < span.length; indexcount++)
                    if (span[indexcount]==target)
                        return indexcount;
            public void getArray(int[] a)
         *  Returns the next keystream generated by the Solitaire  Algorithm
         public int nextKeystream()
              // Step one: Move Joker A one card down.
                    int jokerAindex = search(MainSolitaireDriver(key), 27);
                    System.out.print(jokerAindex);
              // Step two: Move Joker B two cards down.
              // Step three: Perform a triple cut.
              // Step four: Perform a count cut.
              // Step five: Find the output card.
              return 0;
         *  Returns the ciphertext corresponding to the specified
       *  plaintext, according to the current key deck ordering.
         public String encrypt(String plaintext)
              return "";
         *  Returns the plaintext corresponding to the specified
       *  ciphertext, according to the current key deck ordering.
         public String decrypt(String ciphertext)
              return "";
    }

    Main Class
    import java.util.*;
    import java.io.*;
    import java.util.Scanner;
    public class MainSolitaireDriver
       int pcount = 0;
       public int[] key = new int[26];    
       public MainSolitaireDriver()
           getValues();
            public void getValues()
                try
                    Scanner inFile = new  Scanner(new File("input.txt"));
                    for (int counter = 0; counter < key.length; counter++ )
                        key[counter]= inFile.nextInt();
                        System.out.print(key[counter]+" ");
                catch(FileNotFoundException e )
                e.printStackTrace();
                System.err.print("Failure- File Not Found");
         public static void main (String[] args)
                /*String whereInTheWorldMyFileShouldBe = new File("input.txt").getAbsolutePath();
    System.out.println(whereInTheWorldMyFileShouldBe); */
    }Solitaire Class (not main)
    public class Solitaire
         private Deck deck;
         *  Initialize the deck from the current key deck ordering.
         public Solitaire (int[] shuffle)
              deck = new Deck(shuffle);
            public void getArray(int[] Array)
            public int search(int [] span, int target)
                for (int indexcount = 0; indexcount < span.length; indexcount++)
                    if (span[indexcount]==target)
                        return indexcount;
            public void getArray(int[] a)
         *  Returns the next keystream generated by the Solitaire  Algorithm
         public int nextKeystream()
              // Step one: Move Joker A one card down.
                    int jokerAindex = search(MainSolitaireDriver.key, 27);
                    System.out.print(jokerAindex);
              // Step two: Move Joker B two cards down.
              // Step three: Perform a triple cut.
              // Step four: Perform a count cut.
              // Step five: Find the output card.
              return 0;
         *  Returns the ciphertext corresponding to the specified
       *  plaintext, according to the current key deck ordering.
         public String encrypt(String plaintext)
              return "";
         *  Returns the plaintext corresponding to the specified
       *  ciphertext, according to the current key deck ordering.
         public String decrypt(String ciphertext)
              return "";
    }

  • Calling a java static method from javascript

    I am running into issue while calling a java static method with a parameter from javascript. I am getting the following error. Any help is greatly appreciated.
    Thx
    An error occurred at line: 103 in the jsp file: /jnlpLaunch.jsp
    pfProjectId cannot be resolved to a variable
    =================================================
    // Java static method with one parameter
    <%!
    public static void CreateJnlpFile(String pfProjectId)
    %>
    //Script that calls java static method
    <script language="javascript" type="text/javascript">
    var pfProjectId = "proj1057";
    // Here I am calling java method
    <%CreateJnlpFile(pfProjectId);%>
    </script>
    ===================================================
    Edited by: 878645 on Mar 6, 2012 11:30 PM

    Thanks, Got what you are telling. Right now I have one jsp file which is setting the parameter 'pfProjectId' and in another .jsp I am retrieving it. But I am getting null valuue
    for the variable. I am wondering why I am getting null value in the second jsp page?.
    Thx
    ====================================================================
    <script language="javascript" type="text/javascript">
    // Setting parameter pfProjectId
    var pfProjectId = "proj1057";
    request.setParameter("pfProjectId", "pfProjectId");
    </script>
    // Using Button post to call a .jsp that creates jnlp file
    <form method=post action="CreateJnlpFile.jsp">
    <input type="submit" value="Create JNLP File">
    </form>
    //Contents of second .jsp file CreateJNLPFile.jsp
    String pfProjectId = request.getParameter("pfProjectId ");
    System.out.println( "In CreateJnlpFile.jsp pfProjectId " + pfProjectId );
    =======================================================

  • Runtime Error When executing Method from JavaScript

    Greetings In the name of the creator of all things, space, and time. I have a problem with scripting an applet using Javascript (JScript). The problem is as follows: I receive the runtime error - An outgoing call cannot be made since the application is dispatching an input-synchronous call.
    I invoke the applet from a JavaScript from within a web page. The applet populates and display a JTable. From the Table I select an element in a row and press a button which kicks off another page. From within the page I called one of the applet's method i.e. _applet.cfquery(window, hastable).
    This method connects to a data source and returns some data. When the method is invoked I receive the runtime error.
    What is the problem and How do I resolve it? Note: The same code works with Netscape 7.0 with out any problems.
    Particulars:
    Browser: Internet Explorer 6.0 - Version 6.0.2800.1106C (SP1)
    Operating System : Windows 2000 (Service Pack 3)
    Scripting Interface: LiveConnect.
    Scripting Version: JavaScript (1.5)
    I know Microsoft Uses ActiveX to support embedded object. I recently came up on the JavaScript Object
    ActiveXObject(appname.className [,remoteServiceName]). Could I use it to access my applet and how would I specify the name of my applet's? What do they mean by class name. Please help me I have searched the Internet until my eyes almost fall out by I have not found any solutions.

    If the javascript to invoke applet.cfquery(window, hastable) happens automatically (onload,...), try adding a button to your page and using that to invoke applet.cfquery(window, hastable). See if waiting until the applet loads and settles down makes a difference.

  • Access ATG REST webservices from javascript..?

    Hi All,
    Can we access ATG REST web services from Javascript/jQuery..? If yes, then how..?
    Thanks,
    Vishnu

    Hi Nitin, I'm able to access /atg/dynamo/Configuration component's properties using REST services from following code -
    */atg/rest/security/restSecurityConfiguration.xml*
    <resource component="/rest/bean/atg/dynamo/Configuration">
         <default-acl value="[email protected]:read,write,execute"/>
         <property name="httpPort" secure="false"/>
    </resource>
    client Java code :
    public class RestClientRequest {
         public static void main(String[] args) {
              RestSession mSession = RestSession.createSession("localhost", 8180, "[email protected]", "chinna");
              mSession.setUseHttpsForLogin(false);
              try{
                   String loginStatus = mSession.login();
                   if(loginStatus == null || "null".equals(loginStatus)){
                        mSession=null;
                        System.out.println("Login failed");
                   else{
    RestResult result = RestComponentHelper.getPropertyValue("/atg/dynamo/Configuration", "httpPort", null, mSession);
    String test = result.readInputStream();
    System.out.println("\n\n"+result.readInputStream());
    but getting exception when i try to get repository item using the below code
    <rest-security>
    <resource component="/rest/repository/atg/commerce/catalog/ProductCatalog">
    <default-acl>[email protected]:read,write,execute"</default-acl>
    </resource>
    </rest-security>
    Client Java code:
    public class RestClientRequest {
         public static void main(String[] args) {
              RestSession mSession = RestSession.createSession("localhost", 8180, "[email protected]", "chinna");
              mSession.setUseHttpsForLogin(false);
              try{
                   String loginStatus = mSession.login();
                   if(loginStatus == null || "null".equals(loginStatus)){
                        mSession=null;
                        System.out.println("Login failed");
                   else{
    RestResult result = RestResult result = RestRepositoryHelper.getItems("/atg/commerce/catalog/ProductCatalog", "product", null, mSession);
    String test = result.readInputStream();
    System.out.println("\n\n"+result.readInputStream());
    Exception :
    Login successful
    Login Status : ATG3990000
    atg.rest.client.RestClientException: java.io.IOException: Unauthorized Server returned HTTP response code: 401 for URL: http://localhost:8180/rest/repository/atg/commerce/catalog/ProductCatalog/product
         at atg.rest.client.RestSession.createHttpRequest(RestSession.java:755)
         at atg.rest.client.RestSession.createHttpRequest(RestSession.java:722)
         at atg.rest.client.RestRepositoryHelper.getItems(RestRepositoryHelper.java:188)
         at in.vcarve.RestClientRequest.main(RestClientRequest.java:26)
    Caused by: java.io.IOException: Unauthorized Server returned HTTP response code: 401 for URL: http://localhost:8180/rest/repository/atg/commerce/catalog/ProductCatalog/product
         at sun.net.www.protocol.http.HttpURLConnection.getInputStream(Unknown Source)
         at atg.rest.client.RestSession.createHttpRequest(RestSession.java:745)
         ... 3 more
    Thanks,
    Vishnu

Maybe you are looking for

  • No wireless network on Windows 7 boot camp!

    Hey fellow Mac users! I'm having a problem that has been bothering me for the last two days... Once I partitioned my hard drive, and installed Windows 7 on one part, there's no wireless internet connection. I did insert my Mac OS X Snow Leopard DVD o

  • Transfer file from MDMP system to Unicode system

    Hi all, We are facing this problem for some weeks now and our basis team and myself are completely lost on this. Recently we have installed the Polish language (in fact codepage 8859-2) via so called 'MDMP' on our 4.6C HR-system. We did this because

  • Out of order my ipad

    I would like to receive any comments of my ipad problem. A few days ago, I charged my pad during playing podcast. I slept listening the podcat. After wake up I was just shocked. Because my pad is turned off. I tried to turn on many times by using hom

  • How to pick a HDD ?

    Hi, I am looking for a hard disk for a 2005 Toshiba Satellite laptop which I bought in Singapore. Model : Satellite M50-P330Satellite M50-P330 Part number: PSM51L-001001 I checked http://www.toshibadirect.com but could not find the precise model numb

  • Logic level translatio​n 5 - 3.3

    Hi, is there a way to shrink the available output digital voltage range from 5V to 3.3V on a PXIe-6358 in LabVIEW or logic level translator circuits have to be used for ex from Analog Devices? Krivan