Passing arguments to applet

Hi,
i have problem with passing parameters to Applet in OA page. i including the applet in raw text bean and placing the applet tag in setText(). but when i try to pass some dynamic values to the applet its not taking the parameters. Can anyone help me?
here is my sample code
String appletCode = "<HTML><HEAD> <TITLE>Gantt Applet</TITLE> </HEAD><applet code='ScrollingGantt.class' width=970 height=500>";
appletCode = appletCode + "<PARAM NAME='Resources' VALUE='"+pageContext.getParameter("Resources")+"'>";
appletCode = appletCode + "<PARAM NAME='BatchId' VALUE='"+pageContext.getParameter("BatchId")+"'>";
appletCode = appletCode + "<PARAM NAME='BatchNo' VALUE='"+pageContext.getParameter("BatchNo")+"'>";
appletCode = appletCode + "<PARAM NAME='StartDate' VALUE='"+pageContext.getParameter("StartDate")+"'>";
appletCode = appletCode + "<PARAM NAME='EndDate' VALUE='"+pageContext.getParameter("EndDate")+"'>";
appletCode = appletCode + "</applet></HTML>";
OARawTextBean appletBean = (OARawTextBean)webBean.findChildRecursive("Applet");
appletBean.setText(appletCode);
Thanks Nagesh

Hi Tapash,
Try executing this simple example
Applet code :-
import java.applet.*;
import java.awt.*;
public class Demo extends Applet{
String s="";
public void start(){
s = this.getParameter("Name");
public void paint(Graphics g){
System.out.println(s);
setBackground(Color.RED);
setForeground(Color.BLACK);
g.drawString("Hello"+s,150,50);
OAF Code:
Place this code in ProcessRequest
String appletCode = "<applet code='Demo.class' width=970 height=500><param name='Name' value='nagesh'></applet>";
System.out.println(appletCode);
OARawTextBean appletBean = (OARawTextBean)webBean.findChildRecursive("Applet");
appletBean.setText(appletCode);
System.out.println("Text here :"+appletBean.getText());

Similar Messages

  • Pass arguments in a applet

    i know when you run a prog you could pass arguments, can i do with my applet.. like take a textbox in my html page?????

    thx man you're nice
    yes. you can do that. That is actually an <HTML>
    syntax question. Following might help
    <applet code="Chat" width=600 height=400>
    <param name=host value="somewhere.hotwired.com">
    <param name=port value="2323">and on the java side look at the APi and under Applet
    class look for getParameter() method

  • Passing values from applet using POST method to PHP page

    Hello there ;)
    I realy need a help here.. I`ve been working all day on sending mail from applet. I didn`t succeed bcs of the security restrictions.
    So I decided just to pass arguments into PHP page, which process them and send e-mail to me.
    So here is the problem.. I need to send String variables througth POST into my php page. Now I`m using GET method, but I need more than 4000 characters.
    My actual solution is:
      URL url = new URL("http://127.0.0.1/index.php?name=" + name + "&message=" + message);
    this.getAppletContext().showDocument(url,"_self");I really need to rewrite it into POST. Would you be so kind and write few lines example [applet + php code]? I`ve already searched, googled, etc.. Pls don`t copy links to other forums here, probably I`ve read it.
    Thanx in advance to all :)

    hi!
    i`ve got some news about my applet.. so take this applet code:
    public class Apletik extends JApplet {
        public void init() { }
        public void start()
        try
          String aLine; // only if reading response
          String  parametersAsString = "msg=ahoj&to=world";
          byte[] parameterAsBytes = parametersAsString.getBytes();
          // send parameters to server
          URL url = this.getCodeBase();
          url = new URL(url + "spracuj.php");
          URLConnection con = url.openConnection();
          con.setDoOutput(true);
          con.setDoInput(true); // only if reading response
          con.setUseCaches(false);
          con.setRequestProperty("Content=length", String.valueOf(parameterAsBytes.length));
          OutputStream oStream = con.getOutputStream();
          oStream.write(parameterAsBytes);
          oStream.flush();
          String line="";
          BufferedReader in = new BufferedReader(new InputStreamReader(con.getInputStream()));
          while ((aLine = in.readLine()) != null)
           JOptionPane.showMessageDialog(null, aLine);      
           if(aLine.equals("")) break;
          in.close();      
          oStream.close();
        catch (Exception ex)
          JOptionPane.showMessageDialog(null, ex.toString());
    }here is code of spracuj.php which is on server:
    <?php
      if(isset($_POST['msg']))
        echo('hurray!');
    ?>it has only 1 problem.. when i test it on my localhost, everything seems to be all right. but when i post it to my server, i got IOException HTTP 400 error code :( where is the problem? please help me, i`m so close :D thanx

  • How to pass argument to the Java Plugin JVM w/o using the Control Panel?

    I want to deploy an applet to be loaded by the Java Plug In
    and fix some settings of its Java Virtual Machine.
    The JPI Control Panel offers two ways to pass arguments to the JVM,
    none satisfactory.
    1. while interactive via the Control Panel Window.
    This cannot be a solution for a deployed applet.
    or
    2. by editing the system generated file that stores
    the settings of the Plugin Control Panel, using a property
    named javaplugin.jre.params.
    The problem with this method is that if forces to access
    and edit this property file which is stored at various locations
    depending the client platform. Then, it may collide with other
    settings for other applets.
    Is there a way to pass the arguments to the JVM
    from within the html file?
    Has anyone found a solution to this question?
    JPS

    I am interested in this issue as well.
    Did anyone find a reliable way to specify the runtime parameters that should be used by the Java Plug-in in order to execute a given Java applet?
    I believe a good place to specify these runtime parameters would be the applet's JAR manifest: only digitally signed applets should be able to set the desired runtime parameters...
    Any comments / suggestion would be greatly appreciated.
    Regards,
    Marco.

  • Can we pass arguments to JNLP?

    I am new to JNLP and want to know can we pass arguments to JNLP?
    If yes where I can find the info abt it?

    Dolda2000 wrote:
    Will that really work well, though? As far as I can tell, the JNLP client will try to refetch the JNLP file when launching the Java program (reasonable enough). If I were to include
    information from that is only available via the user's web brower's session, I would not be able to recreate that data when the JNLP client tried to refetch the JNLP file.If you're worried about that why not use a user specific cookie?
    Your CGI script can check for/generate/pass one along with the XML stub.
    As far as I know the JNLP is stateless. It loads once,
    the information is cached, your application gets run....
    I already do this with <applet> tags (not currently JNLP) to identify returning users
    and pass dynamic parameters to applets. I will be updating to JNLP after a rewrite
    of some code.
    P

  • How to run a java class from a shell script with passing arguments

    hi,
    I have a jar with all the required classes. I was using ant to run the classes i needed.
    But now i want to use a shell script to run the class, also the class accepts some arguments so when script is run it should accept arguments.
    So can any one tell me how to set class paths, jar location and call the required class from shell script or batch file with passing arguments to it.
    Thanks in advance.

    Let's say that the order of arguments is as below
    1. Jar file name
    2. Classpath
    Your shell script would look like this
    java -cp $CLASSPATH:$2 -jar $1 I am assuming that your jar file has the required main-class entry in its manifest. Note that $1...$9 represent the arguments to this shell script.
    The same goes for a batch file
    java -cp %CLASSPATH%;%2 -jar %1

  • How to pass argument in manifest file

    Hi,
    I want to pass argument to main class in jar. Is there any option in manifest file.

    Hmm..
    Seems that my sentence above isn't so correct.
    It possible to add custom attribute: value pairs into manifest file and
    read it later from Java class.
    Here is code sample:
    public class ManifestTest {
        public static void main(String[] args) {
            try {
                java.util.jar.JarFile jar = new java.util.jar.JarFile(System.getProperty("java.class.path"));
                for (java.util.Iterator it = jar.getManifest().getMainAttributes().keySet().iterator();it.hasNext();) {
                    Object curKey = it.next();
                    System.out.println("key: " + curKey + ", value: " + jar.getManifest().getMainAttributes().get(curKey));
            } catch (Throwable t) {
                System.out.println("exception occured: " + t);
    }

  • How can I pass arguments to a TestStand sequence with LabWindows 6 ?

    Hi
    I have created sequences in a TestStand file.
    I want to program a sequence with Labwindows 6 which would call all these existing sequences (containing parameters).
    I don't have any problems to create the steps "SequenceCall" but i don't know how to pass arguments to the sequences with the TS API.
    I have used the look-up strings "TS.SData.SFPath", "TS.SData.SeqName", "TS.SData.ThreadOpt" to program the sequence file / sequence and the multithread option. But now how to program the arguments passing ? I think there is something with the lookup string "ST.SData.ActualArgs"...
    Thank u very much for any help

    I'm not sure if you want to pass values from TestStand to LabWindows or if you want to pass values in TestStand from a sequence call step to a called sequence.
    To get TestStand variables from LabWIndows, use the following function:
    tsErrChk (TS_PropertyGetValNumber(testData->seqContextCVI, &errorInfo, "Locals.StartPoint", 0, &dStartPt));
    iStartPt = (int)dStartPt;
    The TS_PropertyGetValNumber gets the TestStand variable Locals.StartPoint and puts it into the LabWindows variable called dStartPoint. Numbers to and from Test Stand are always a double type. The next line converts it to an integer.
    To put a LabWindows value to TestStand, use TS_PropertyPutValNumber.
    To pass values from a sequence call step to a called sequence, create variables in the Parameters t
    ab on your main sequence. Create same variables on the Parameters tab of the called sequence. In main, specify module to be called in calling step. There is a paramters section on the Edit Sequence Call dialog box which appears. Check the Use Prototype of the Selected Sequence box. You can then list all the parameter variables in the parameters section.
    Hope this is what you want.
    - tbob
    Inventor of the WORM Global

  • Passing Arguments in a Multiple JFrame project

    I am trying to pass Arguments from MainApp.java to SubApp.java.
    Is there someone that have an example or fix the sample program included?
    tks a lot
    sage49
    I based my program on the following 2 programs that I got from this forum!!
    The following is the MainApp.java
    import javax.swing.*;
    import java.awt.event.*;
    class MainApp extends JFrame {
        MainApp() {
            super( "Main Application" );
            JButton button = new JButton( "Show Sub Application" );
            button.addActionListener( new ActionListener() {
                public void actionPerformed( ActionEvent e ) {
    //  need to pass a string to SubApp in the following line
                    JFrame app = new SubApp();
                    dispose(); 
            getContentPane().add( button );
            setDefaultCloseOperation( DISPOSE_ON_CLOSE );
            pack();
            show();
        public static void main( String[] args ) {
            MainApp app = new MainApp();
    }The following is the SubApp.java
    import javax.swing.*;
    import java.awt.event.*;
    class SubApp extends JFrame {
    // need to accept a String as Arguments
        SubApp() {
            super( "Another Application" );
            JButton button = new JButton( "Show Main Application" );
            button.addActionListener( new ActionListener() {
                public void actionPerformed( ActionEvent e ) {
                    JFrame app = new MainApp();
                    dispose();
            getContentPane().add( button );
            setDefaultCloseOperation( DISPOSE_ON_CLOSE );
            pack();
            show();
        public static void main( String[] args ) {
            SubApp app = new SubApp();
    }

    Hi,
    I have done what you suggested, Now I get an error on the subApp on the main.
    see What I tried in the code.
    MainApp.java
    import javax.swing.*;
    import java.awt.event.*;
    class MainApp extends JFrame {
        MainApp() {
            super( "Main Application" );
            final String a ="this is the string";
            JButton button = new JButton( "Show Sub Application" );
            button.addActionListener( new ActionListener() {
                public void actionPerformed( ActionEvent e ) {
                    JFrame app = new SubApp(a);
                    dispose(); 
            getContentPane().add( button );
            setDefaultCloseOperation( DISPOSE_ON_CLOSE );
            pack();
            show();
        public static void main( String[] args ) {
            MainApp app = new MainApp();
    }The SubApp.java
    import javax.swing.*;
    import java.awt.event.*;
    class SubApp extends JFrame {
            private String mystring;
            SubApp(String mystring) {   
            super( "Another Application" );
            this.mystring = mystring;
            JButton button = new JButton( "Show Main Application" );
            button.addActionListener( new ActionListener() {
                public void actionPerformed( ActionEvent e ) {
                    JFrame app = new MainApp();
                    dispose(); 
            getContentPane().add( button );
            setDefaultCloseOperation( DISPOSE_ON_CLOSE );
            pack();
            show();
        public static void main( String[] args ) {
           // tried    =    SubApp app = new SubApp(mystring);
           // tried    =    SubApp app = new SubApp(a);
           // tried    =    SubApp app = new SubApp(String a);  
           // tried    =    SubApp app = new SubApp(String);                 
            SubApp app = new SubApp();                // this is the line I get the error
    }I get the following error:
    Cannot find Symbol
    symbol  : constructor SubApp()
    location: class SubApp
            SubApp app = new SubApp();Tks a lot
    sage49

  • Creating pocess intance of a different process and passing arguments

    Creating Process instance of a different process:
    I have two different process: Main_Flow (id: MainFlow) and Second_Flow (id: SecondFlow). In the first process I am reading a csv file. Each line of the file has four columns. After reading each line I have to initiate Second_Flow and pass the read data from the file. (Pls find the code below for the whole process):
         fileReader = FileReader(arg1 : fullFileName);//filename is of file type and have file name and path
         Java.Io.BufferedReader reader = BufferedReader(arg1 : fileReader);
         String str;
         int countLines = 0;
         while ((str = reader.readLine()) != null)
              strColumn = str.split(delim : ",");
                   int ColumnCnt = 0;
                   while (ColumnCnt < 4)
                        //defining variables
                        String appNo;
                        String custNo;
                        String loanAmm;
                        String loanDate;
                        //logMessage("Value at Column: " + ColumnCnt + " is " + strColumn[ColumnCnt]);
                        if (ColumnCnt == 0)
                             arrLoanData["appNo"] = strColumn[ColumnCnt];
                        else if (ColumnCnt == 1)
                             arrLoanData["custNo"] = strColumn[ColumnCnt];
                        else if (ColumnCnt == 2)
                             arrLoanData["loanAmm"] = strColumn[ColumnCnt];
                        else if (ColumnCnt == 3)
                             arrLoanData["loanDate"] = strColumn[ColumnCnt];
                        arrLoanData["descriptionArg"] = "AutoInstance: " + formatTime('now', timeStyle : Time.SHORT);
                        arrLoanData["genByArg"] = "Automatic";
                        ProcessInstance.create(processId : "/SecondFlow", arguments : arrLoanData, argumentsSetName : "BeginIn");
                        ColumnCnt = ColumnCnt + 1;
              countLines = countLines + 1;     
    (“The code is in Java and not in PBL”)
    I have to pass appNo, custNo, loanAmm and loanDate as the arguments. The Argument will be of Any[String] type. The argument set name of Second_Flow is “BeginIn”. But I am not getting anything in Second_Flow.
    What can I do in the argument mapping of begin of Second_Flow to get the passed argument (array)?

    the argument 'arguments' for the method ProcessInstance.create receives a map of the arguments that the 'argumentSetName' argument set will receive.
    so for example if your second flow has 2 arguments, String name, Decimal value and String[] content your method invocation would be:
    ProcessInstance.create(processId : "/SecondFlow", arguments : {"name": strNameFromCsv, "value": valueFromCsv, "content": ["a","b","c","d"]}, argumentsSetName : "BeginIn");

  • How to pass argument in main function ?

    How to pass arguments in main function of one class from another class ?
    I don't want to pass argument from command prompt.
    I want to try something like this -
    class Test{
    public static void main(String args[]){
    for(int i=0;i<args.length;i++)
         System.out.println(args);
    class Fun{
    public static void main(String args[]){
         Test t=new Test("Hello","good bye");
    when i run Fun class it gives error.
    Suggest me how can i do that.

    In Fun class main method does not take arguments that is fine. In Test class instead of main method you can have constructor to take input parameters as suggested by BalusC
    However, if you want to make your existing code work, you can call (though not appropriate) main() method of Test class from main() method of Fun class (As main() method is static object is not required to invoke this):
    Test.main(new String[]{"Hello","good bye"});Here is your code:
    class Test{
    public static void main(String args[]){
    for(int i=0;i<args.length;i++)
    System.out.println(args);
    public class Fun{
    public static void main(String args[]){
    //Test t=new Test("Hello","good bye");
    Test.main(new String[]{"Hello","good bye"});
    } Thanks,
    Mrityunjoy                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                   

  • Passing arguments to a custom component in the constructor

    I would like to know if it is possible to pass arguments to a
    custom component in the constructor when I'm instantiating it
    within Actionscript. I've not seen anyone do this, so at the moment
    I have a couple of public properties defined on the custom
    component and then do the following:
    var myComponent:TestComponent = new TestComponent();
    myComponent.propertyOne = true;
    myComponent.propertyTwo = 12;
    etc.
    Whereas I'd like to do something like:
    var myComponent:TestComponent = new TestComponent( true, 12
    Any ideas if this is possible?

    Another approach as opposed to creating init function is to link symbol with autogenerated class (just assign it a class but do not create *.as file for it) and use it just as graphical view with no functionality (well only MovieClip's functionality).
    ViewClip.as
    public class ViewClip extends MovieClip {
        public var view:MovieClip;
        public function ViewClip(){
            this.view = instantiateView();
            this.addChild(view);
        protected function instantiateView():MovieClip {
            return new MovieClip();
    Circle.as
    public class Circle extends ViewClip {
        public function Circle(scaleX:Number, scaleY:Number) {
            super();
        override protected function instantiateView():MovieClip {
            return new ClassView();

  • Pass arguments to JSF tag attributes like id oder value

    Hi!
    I started with JSF some weeks ago and have some questions that i could not find in FAQ or tutorials.
    My page structure uses some <jsp:includes>. Each included page uses JSF.
    The structure is (example - users):
    Users.jsp
    |
    |(incl)
    |
    Mainpage.jsp (=Framework)
    |
    |(incl)
    |
    Browser.jsp (=Table)
    In "Users" all specific data is set. In "Browser" there is a <h:form> tag and a <h:dataTable> tag.
    The result should be a simple table with users inside.
    So I want to pass arguments to those sub-pages.
    1) -> form-ids as parameter:
    <h:form id="#{sessionScope.formName}">
    ... does not work, because ids have to start with a character or "_".
    formName is set as followed:
    session.setAttribute("formName", "form_users");
    2) ->beans as parameter:
    <h:dataTable id="browser_table_#{sessionScope.id}" styleClass="browser_table"
    var="user" value="#{sessionScope.user_list}">
    ... does not work. "id" is requested to be a static value and "value" can't find the bean by this string.
    user_list is set as followed:
    session.setAttribute("user_list", "UserListBean.users");
    (UserListBean.users is an ArrayList)
    Is there an error in my thinking? Or is there a way to pass arguments as i want?
    Thanks!

    sorry ... mistake in topic: "oder" = "or" of course :)

  • RMI Codebase Passing Arguments

    I'm new to RMI and Java.How do you pass arguments using serialization in RMI? I'll be passing the arguments from a servlet. for example if i want to pass a string object from a servlet to the calling client service. Thanks

    Can you please provide me with a better direction in terms of developments (i.e examples)? thank you

  • How to execute adobe air app & pass argument from Flex ?

    Helo everyone,
    May i ask a question, How to execute adobe air app & pass argument from Flex ?
    Thanks in advanced.
    Jacky Ho.

    Hello Jacky,
    You can find an example here
    http://spreadingfunkyness.com/passing-parameters-to-adobe-air-at-startup/

Maybe you are looking for

  • Driver Program of Smartform

    Hi Folks, Can any body post the sample driver program of smart form? I need the same to call a smartform which created. thanks Siddarth

  • How do I stop outlook from keep synchronizing old emails?

    How do I stop my outlook - I have office 365 proplus - from synchronizing files from my gmail account? I already have all the files I need and this process keeps going on and it is making my computer slow and it gave me a message of no space availabl

  • How can i put a file into blob using jdbc !?

    Hi i tried to put a file into blob , but got a problem..... My environment:windows 2000pro,JBuilder 5.0 enterprise,oracle 8.1.6,(not install oracle jdbc driver ) a part of program(my program is very uglily,if anyone want,later i paste it ba....~_~) /

  • Connecting Apple TV Through My iMac

    Hi, I would like to connect my Apple TV through my iMac rather than directly through my router.  Either wired, WIFI or using Bluetooth? Is it possible to share the internet connection via my iMac this way? ...jono...

  • Time capsule 'error occurred reading settings'

    I was trying to configure 'back to my Mac' when I lost my Time Capsule. Have now got most systems OK and the Airport Utility window shows that I am connected to the internet; however it states 'no base stations found, searching'; on 'other wi-fi devi