How can I pass a variable to an applet in JSP?

I want to invoke an Applet in JSP and pass a variable( ie. port) to the Applet. I do as follows:
<applet code="best.Applet1.class" width=400 height=300 >
<param name=port1 value=port>
</applet>
in Applet1.java , I use getParameter("port1"),yet I got character string "port" ,not the value of port(i.e. 100).
How can I get 100 not "port"? Thanks!!!

Assuming that port is a variable defined and initailized in the jsp:
<applet code="best.Applet1.class" width=400 height=300 >
<param name=port1 value=<%= port %>>
</applet>

Similar Messages

  • How can i pass a variable instead of a table name in the Select statement.

    Dear all
    how can i pass a variable instead of a table name in a select statement ?
    Example :-
    Begin
    P_get_procedure_tname (aap_name,otable_name);--It will take an application name and will return a table name
    Select col1 into ocol1
    from  ---- here i want to pass the variable OTABLE_NAME
    End;How can i pass this ?

    Hi,
    You can use dynamic sql.
    EXECUTE IMMEDIATE 'SELECT COL1 INTO ' || OCOL1 || ' FROM " || OTABLE_NAME;
    {code}
    cheers
    VT                                                                                                                                                                                                                                                                                                   

  • How can I pass environment variables to the child process?

    How can I pass environment variables to the child process? This is what I tried and it didn't work.
         static public void main (String[] args) throws Exception {
              ProcessBuilder b = new ProcessBuilder("java", "-cp", ".", "Child");
              Map<String, String> map = b.environment();
              map.put("custom.property", "my value");
                 b.redirectErrorStream(true);
              Process p = b.start();
              BufferedReader reader = new BufferedReader (new InputStreamReader(p.getInputStream()));
              String line = null;
              while (null != (line = reader.readLine())) {
                   System.out.println(line);
         public static void main(String[] args) {
              System.out.println("The value of custom.property is : " + System.getProperty("custom.property"));
         }and the result is:
    The value of custom.property is : null

    Complete test:
         static public void main (String[] args) throws Exception {
              ProcessBuilder b = new ProcessBuilder("java", "-Dcustom.property=my property value", "-cp", ".", "Child");
              Map<String, String> map = b.environment();
              map.put("custom.property", "my environment value");
                 b.redirectErrorStream(true);
              Process p = b.start();
              BufferedReader reader = new BufferedReader (new InputStreamReader(p.getInputStream()));
              String line = null;
              while (null != (line = reader.readLine())) {
                   System.out.println(line);
         public static void main(String[] args) {
              System.out.println("Property value of custom.property is : " + System.getProperty("custom.property"));
              System.out.println("Environment value of custom.property is : " + System.getenv("custom.property"));          
         }

  • How can we  use java variable in javascript code on JSP page?

    How can we use java variable in javascript code on JSP page?
    Pls help

    Think about it:
    JSP/Java is executed on the Server and produces HTML+JavaScript.
    Then that HTML+JavaScript is transfered to the client. The client now interpretes the HTML+JavaScript.
    Obviously there's no way to access a Java variable directly from JavaScript.
    What you can do, however, is write out some JavaScript that creates a JavaScript variable containing the value of your Java variable.

  • How can i pass a variable's value from PR to PFR

    Dear all,
    hope you are fine.
    i would like to pass a variable's value from PR to PFR.
    how can i do that.
    please suggest.
    in PR:
    String transactionId = (String) vo_trans.first().getAttribute("Getnexttrans");
    i would like to get this value to PFR.

    Mofizur,
    You can achieve the same using Session variable.
    If u are not executing the VO after PR. Then you will be able to get the same value as u are using in PR
    String transactionId = (String) vo_trans.first().getAttribute("Getnexttrans");
    Note - You have a few of the threads left open, mark it as answered if solved.
    Regards,
    Gyan

  • How can I pass a variable  value from first jsp page to thired jsp page

    In my program ,threr are three jsp pages . I want the first pages's variable value in to thired page .How can I acess.
    I used the request.getparameter() ,but when I print the value , null value is getting .

    request parameters only last for one request.
    To save them longer than that you need to save them somewhere.
    Couple of alternatives
    1 - store them to session
    session.setAttribute("username", request.getParameter("username");
    2 - create a hidden field on page 2 and store the value from page 1 there. When you submit page2, you can get it on page3 with request.getParameter again.
    <input type="hidden" name="username" value="<%= request.getParameter("username") %>">

  • How can I pass a variable(s) between two swfs?

    Hello all,
    I was wondering if it is possible to pass variables between
    two standalone swfs that are not being hosted on a webserver.
    I am creating a flash projector to go on a CD Rom and want to
    load another swf into the _root level and in the process, want to
    pass a variable or two to the "new" swf that is being loaded. Any
    help or insights that you can offer would be greatly appreciated!
    Thanks for your help.
    Tim

    if by _root level you mean you're loading something into
    _level0 you can't won't be able to use the localconnection. the
    sharedobject is your only option.

  • How can I pass a variable between JSP and Role Form

    I need to pass a variable from (a copy of) applicationmodify.jsp to the IDM Role Form so that the variable is available within the Role Form at display. We've tried getAttribute and setAttribute modifying both the Role Form and the applicationmodify JSP and can get the form to the role form but not accessible but have had no other success. Has anyone had any success in doing this? Any suggestions would be appreciated.

    if by _root level you mean you're loading something into
    _level0 you can't won't be able to use the localconnection. the
    sharedobject is your only option.

  • How can I pass Global Variable from Page1 to Page2

    I have the following senario.
    Pag1 - report is based on following PL\SQL
    declare
    g1 varchar2(100);
    begin
    g1 = select * from emp where dept = 10;
    return g1;
    end;
    Now I have Page2 - based on following PL\SQL
    declare
    g2 varchar2(100);
    begin
    g2 := g1; -- here i want to use variable g1???
    return g2;
    end;
    My question is - How can I use variable g1 from P1 in my new page P2.
    Thanks,
    Deepak

    Hi Andy,
    Thanks for the clarification.
    I did exactly the same, created a new Region with HTML (PL\SQL) and got the output. it was fine.
    Now when I am using exactly the same code in a Report (PL/SQL function returning a SQL Query), I am getting the following error.
    DECLARE
    g VARCHAR2(100);
    BEGIN
    g := 'This is a test string';
    APEX_UTIL.SET_SESSION_STATE('G_SQL_STRING', g);
    htp.p(v('G_SQL_STRING'));
    END;
    ERR-1002 Unable to find item ID for item "FLOW_SECURITY_GROUP_ID" in application "4000".
    ERR-1002 Unable to find item ID for item "G_SQL_STRING" in application "4000".
    I am doing the same thing, nothing changed....only difference is in 1st case I am using HTML (PL\SQL) Region and in 2nd case using the REPORT Region (PL/SQL function returning a SQL Query)
    thanks,
    deepak

  • How can I pass a variable to a form to pre-fill form fields on load?

    Hi all,
    I am developing a Windows Form Applicaiton in C# to register new users and walk them through a signup process.The application does a lot of other things as well. This part of it collects their personal information and saves the data to the database. Part of the process requires the user to complete a pdf form (W-4 tax form). I would like to pre-populate as many form fields as possible for them when the pdf launches, and not have them enter anything to get their data to prefill the form fields.
    My issue is I can't figure out how to get the pdf to know who is loading the form so I can do the SQL select and populate the form fields. I need to do a select * from Table where UniqueID="xxxxx" but how can I get the form to know on load what "xxxxx" is so it grabs the users personal info from the database?
    I have searched high and low and found nothing on how to do this without doing some hoakey hack outside of the application or pdf doc.
    I am creating/editing the form in LiveCycle Designer 8 and am loading the form for use by the user in acrobat 9.
    Any help,ideas, or nudging in the right direction would be much appreciated!

    I found this solution:
    REPORT YRT_TEST4.
    data: r_range type range of matnr.
    perform test changing r_range.
    *& Form test
    form test changing p_r_range like r_range.
    endform. " test
    REgards,
    Ravi

  • How can I pass a variable from Test Stand to CVI by reference

    Hi!
    I can't to pass numeric or boolean variable from Test Stand (for example: FileGlobals.StopFlag) into the step (CVI function).
    Function prototype: 
    void __declspec(dllexport) __cdecl PC2_WaitWhileResponceAppear(tTestData *testData, tTestError *testError, int *iStopFlag).
    When variable has bin changed I can't see this change from my function.
    CVI 2010, Test Stand 2010
    Can anybody help me?

    Hey Rombar,
    It is certainly possible to pass variables by reference; for example, if you go to <TestStand Directory>/Examples/Demo/C and open the computer.seq file, you can see one of the example sequences that uses CVI modules. If you click on one of these steps, you'll see that some of the parameters, such as the error information, is passed with pointers. This is a pass by reference.
    To help narrow this down, it'd be good for us to figure out a few things about how the code is run. First, if you go to Configure > Adapters, select the CVI adapter and choose Configure, you can see options for this adapter. Do you have it configured to run in an external instance of CVI or as an in-process call?
    Also, if you're wanting to see a change made in TestStand in your external code, this makes me think that you're wanting to run the code and then continue to execute your TestStand sequence while the code runs. How did you configure this behavior? For example, are you calling this code as a separate sequence in a new thread, or are you using another method to run this code while the sequence continues to run?
    Finally, if we could see a screenshot of how you're configuring the parameters on the TestStand step, that might be helpful as well.
    Daniel E.
    TestStand Product Support Engineer
    National Instruments

  • How can we pass selected combo box value to a jsp pag?

    Hi All,
    I want to pass selected combo box value to a same jsp page's variable.
    i am using javascript
    <select onchange="this.options[this.selectedIndex].text">
    </select>
    this selected value should be invoked for a jsp page's variable.
    Excepting for favorable reply
    Vansh

    select2.jsp
    <script>
    function x()
         alert(document.f.s.options[document.f.s.selectedIndex].text);
         document.f.submit();
    </script>
    <body>
    <form method="get" name="f" action="select2.jsp">
    <select name="s" onchange="x()">
    <option checked>--select--</option>
    <option value="1"> vijay </option>
    <option value="2"> kumar </option>
    </select>
    </form>
    </body>

  • How can I pass a Presentation Variable (Date) into a prompt

    Hello
    How can I pass a Presentation Variable (date) into a prompt? I seem to be able to do this successfully for a non-date value but have had no luck with a Date variable.
    Here's a simplistic version of what I'm trying to do:
    1. I have a Presentation Variable called startDate which is a Date that defaults to this SQL - SELECT "Reporting Dates"."Measure Date" FROM Trading WHERE "Reporting Dates"."Date Name" = 'Current'.
    2. I now want to pass this variable into a prompt with SQL like this: SELECT "Position Date"."Position Date" FROM Trading where "Position Date"."Position Date" = date'@{startDate}{2009-04-24}'
    I get this error: Datetime value @{startDate}{2009-04-24} from @{startDate}{2009-04-24} does not match the specified format.
    Now I can use the exact same syntax in a filter. For example, a simple Answers request where I pick Position Date with a filter saying "Position Date"."Position Date" = date'@{startDate}{2009-04-24}' works fine.
    What am I doing wrong?
    Thanks!

    Can you provide more information please?
    1. What is the format of the first date prompt, is it YYYY-MM-DD or?
    2. Which data type is Position Date."Position Date" in the physical layer, date or date time?
    3. What is the column formula in the first prompt?
    4. The first prompt is set to drop-down or?
    5. If you are using this SQL Results in the second prompt:
    SELECT "Position Date"."Position Date" FROM Trading where "Position Date"."Position Date" = date '@{startDate}{2009-04-24}'
    then @{startDate} must be in YYYY-MM-DD format to work properly, otherwise (for example):
    datetime value 01/01/2000 from 01/01/2000 does not match the specified format.
    This doesn't work for example:
    SELECT Times.time_id FROM "Normal model" where Times.time_id =date '01/01/2000'
    Regards
    Goran
    http://108obiee.blogspot.com

  • How can I use environment variables in a controller?

    Hi all,
    How can I use environment variables in a controller?
    I want to pass a fully qualified directory and file name to FileInputStream and would like to do it by resolving an env variable, such as $APPLTMP.
    Is there a method somewhere that would resolve this??
    By the way,Did anyone used the class of "oracle.apps.fnd.cp.request.RemoteFile"?
    The following is the code.
    My EBS server is installed with 2 nodes(one for current,and other is for application and DB).I want to copy the current server's file to the application server's $APPLTMP directory. But the result of "mCtx.getEnvStore().getEnv("APPLTMP")" is current server's $APPLTMP directory.
    Can anyone help me on this?
    private String getURL()
    throws IOException
    File locC = null;
    File remC = new File(mPath);
    String lurl = null;
    CpUtil lUtil = new CpUtil();
    String exten;
    Connection lConn = mCtx.getJDBCConnection();
    ErrorStack lES = mCtx.getErrorStack();
    LogFile lLF = mCtx.getLogFile();
    String gwyuid = mCtx.getEnvStore().getEnv("GWYUID");
    String tmpDir = mCtx.getEnvStore().getEnv("APPLTMP");
    String twoTask = mCtx.getEnvStore().getEnv("TWO_TASK");
    // create temp file
    mLPath = lUtil.createTempFile("OF", exten, tmpDir);
    lUtil.logTempFile(mLPath, mLNode, mCtx);
    Thanks,
    binghao

    However within OAF on the application it doesn't.
    what doesnt work, do you get errors or nothing ?XX_TOP is defined in adovars.env only. Anywhere else this has to go?
    No, it is read from the adovars.env file only.Thanks
    Tapash

  • How can I pass a value into a page fragment?

    How can I pass a value into a page fragment?
    I am implementing four search screens. And the only thing different about them will be their backing bean.
    So I’d like to do something like have four pages, each which retrieves its appropriate backing bean, sets that bean to a variable, and then includes a page fragment which contains the generic search page code (which will make use of that variable).
    The code in the four pages would be something like this:
    <?xml version='1.0' encoding='windows-1252'?>
    <jsp:root xmlns:jsp="http://java.sun.com/JSP/Page" version="2.0"
    xmlns:c="http://java.sun.com/jsp/jstl/core">
    <jsp:directive.page contentType="text/html;charset=windows-1252"/>
    <c:set var="searchPageBackingBean"
    value="#{pageFlowScope.employeeSearchPageBean}"
    scope="page"/>
    <jsp:include page="./SearchPageBody.jsff"/>
    </jsp:root>
    At this point, what I’m seeing is that the fragment page, SearchPageBody.jsff, has no visibility of the searchPageBackingBean variable, either referencing it as #{pageFlowScope.searchPageBackingBean} or just #{searchPageBackingBean}

    The following will work, assuming you are needing to access a managed bean:
    Put this in the parent page:
    <c:set var="nameOfSearchPageBackingBean"
    value="employeeSearchPageBean"
    scope="request"/>
    Put this in the child, SearchPageBody.jsff:
    <c:set var="searchPageBean"
    value="#{pageFlowScope[nameOfSearchPageBackingBean]}"
    scope="page"/>

Maybe you are looking for

  • T2 Digitizer frozen after soft,warm,hard resets.Can not get it to calibrate at all.

    My T2 occasionally has to be recalibrated. I downloaed DigiFix some months ago and it seemed to help a bit. I hot synced my data last night and all was well. This morning I could not tap my screen to access anything. I tried cleaning carefully around

  • IMac Plastics & Stand Questions

    Are the (poloycorbonite) plastics as good as regular plastics, I mean does it get brittle over time. and how tough is the stand mount in the iMac?

  • Quality-Invoicing for Blocked stock

    Hi I did GR for material against PO for 50 pcs, During QA32 stock posting i posted 30 pcs to Unres. stock(101) and 20 pieces to blocked stock(350) storage locations. Now when I am trying to create MIRO invoice verification, I am getting all the 50 pc

  • Importance of the subform in adobe forms

    Hi,    Since i am new to this adobe forms, can any one tell me the importance of the subform and difference between Body page & Main page of the layout.    I was trying to use the adobe forms to print the internal table data, but at the end of the in

  • MySQL RDS in Amazon Web Services with EM12c

    I have MySQL RDS in Amazon Web Services.  Can I setup monitoring in EM12c for that?  My version of EM12c is 12.1.0.4 and my version of MySQL is 5.6.22