Passing Java Script to Java.

Hi everyone,
How can I pass a Java Script variable to a Java code ?
Thanks a lot.
Regards.

David,
You whant to pass JS variable
from:
1. Script running on client (in HTML page)
2. Script running on server (via some JS interpreter in Java, like Rhino or FESI)
to:
1. Applet on page
2. Server-side code (servlet)
Please clarify
VS

Similar Messages

  • What're the differences between JSP, Java Script, and Java Applet?

    I am confused by the concepts: JSP (Java Server Page), Java Script, and Java Applet? What are their main differences?

    I don't know about differences, but one of their main similarities is that each of them has a page in Wikipedia.
    JSP
    JavaScript
    [Java applet|http://en.wikipedia.org/wiki/Java_applet]
    There. That should give you enough information.

  • Java script with java

    sir i have seen that java 1.6 mustang version is supporrting java script
    if it is so please any one can help me on how to make my JEditorPane
    to support java script
    not only to jEditorPane but to any other swings component
    i tried in all ways please can any one give me this help

    Hello Farhan,
    The OP stated that there is no condition on the process. In this case, I believe only 'SUBMIT' will cause the process to be fired.
    "you can put anything in the string of the doSubmit."Well, you can do that, but it will have an effect only if you are using the REQUEST variable to condition a process. Otherwise, nothing will happen, and you want even receive an error message, because no error actually exist (as I believe happened with the OP case).
    Regards,
    Arie.

  • Problem  in merging java script and java code

    hi,
    i want to merge java and javascript code but it is giving some surprising results.
    this is my code:
    <script language = "javascript">
    <%
    String query_result= "1";
    String buttontype="";
    buttontype=(String)session.getAttribute("buttontype");
    query_result = (String) session.getAttribute("query_result");
    out.println(query_result);
    if(buttontype!=null&&(buttontype.equals("submit")))
    out.println(buttontype);
    %>
    alert(<%=ka%>)
    </script>
    <%
    %>
    now if i'll move "<script language = "javascript">" to:
    <%
    String query_result= "1";
    String buttontype="";
    buttontype=(String)session.getAttribute("buttontype");
    query_result = (String) session.getAttribute("query_result");
    out.println(query_result);*/
    if(buttontype!=null&&(buttontype.equals("submit")))
    out.println(buttontype);
    %>
    <script language = "javascript">
    alert(<%=query_result%>)
    </script>
    <%
    %>
    then it prints correctly and gives alert "1" but if i'll change query_result="manish" then it is not giving alert also
    i don't know wht is happening
    plz help me out
    manish

    hi pgeuen,
    Thanx for ur reply
    now its working i have changed my jsp exp. tag to
    alert("\"<%=ka%>\"")
    and it is displaying correctly.
    and if i'll give the scripting tags in "if block"then it will work but till now i didn't get why i was not getting any output when the scripting tags covers the whole jsp code. i think we can mix java script and jsp in any way.
    well thanx a lot.
    manish

  • How to call Java script from java code?Can Jscript be executed at server?

    Hi All,
    We are using 'WebTrends' tool to analyze our site usage pattern.
    To use WebTrends, we need to :
    1) call Java Script code from the java code
    2)Java script has to be executed at server.
    Please comment on two points mentioned above. If yes, please let me know how to do them?
    Thanks in advnce,
    Regards,
    Ganga

    You can check out Rhino project.
    [http://www.mozilla.org/rhino/]

  • Expand Collapse Feature in OBIEE 10.1.3.4 version using Java script Issue

    Hi All,
    Tried to implement this script in OBIEE 10.1.3.4, but throughs error. Can any one help me in this regards
    Steps followed
    1. Create an answers report pulling Top Relations, Sub Relationship and Customer from the dimension and sales amount from the Sales fact
    2. For Sub Relationship and Customer give the left padding as 25.
    3. Create a pivot table view make Top Relationship, Sub Relationship hidden and select show the total before and select labels only (no totals) in the pivot table.
    4.Add the image files in and the following code for Top Relationship, Sub Relationship columns select the data format to as HTML image and change it to custom text and add the following.
    @[html]<img onclick="ExpandCollapse(this)" src="res/s_oracle10/images/PropertyGroup_minus.gif">@H
    5. Add a narrative view and add the following java script.
    // Java Script
    function ExpandCollapse( el )
         // Grab the ROW that was clicked and the TABLE that contains it
         var tr = el.parentElement.parentElement;
         var tbl = tr.parentElement.parentElement;
         // Set the alternating display values for hiding/showing the row
         var sDisplay = ( el.src.indexOf( "minus" ) == -1 ) ? "" : "none";
         var sDisplayReverse = ( el.src.indexOf( "minus" ) == -1 ) ? "none" : "";
         //Switch the icon for the clicked row
         el.src = "C:/Manohar/HTMLTest/PropertyGroup_" + ( el.src.indexOf( "minus" ) == -1 ? "minus" : "plus" ) + ".gif";
         // Starting with the row below the clicked row, start checking each row
         for ( var i = tr.rowIndex + 1; i < tbl.rows.length; i++ )
              // Set the Current row indicator nad the left padding value
              var trCurrent = tbl.rows( i );
              var trCurrentLeft = trCurrent.cells(0).style.paddingLeft;
              // if the current row contains an IMG in it, it's a clickable level and we either have to stop processing,
              // or reset the icons to a + as it's being collapsed
              if ( trCurrent.cells( 0 ).firstChild && trCurrent.cells( 0 ).getElementsByTagName( "IMG" ).length )
                   // If the current row is at the same level or above in the tree, then stop processing,
                   // else reset all the signs below it, essentially collapsing all branches underneath the one that is beig collapsed.
                   if ( stripTrailing(trCurrentLeft , UOM_SIZE) <= stripTrailing(tr.cells(0).style.paddingLeft , UOM_SIZE) )
                   { break; }
                   else
                        if (el.src.indexOf( "minus" ) == -1 )
                             trCurrent.cells(0).getElementsByTagName("IMG").item(0).src = "C:/Manohar/HTMLTest/PropertyGroup_plus.gif";
              // Now, we determine if the row should be hidden or shown.
              if ( eval(stripTrailing(tr.cells(0).style.paddingLeft, UOM_SIZE)+ INDENT_SIZE) < stripTrailing(trCurrentLeft, UOM_SIZE) && el.src.indexOf( "minus" ) >0 )
                   trCurrent.style.display = sDisplayReverse;
              } else
                   trCurrent.style.display = sDisplay;
    Thanks,
    Kumaravel
    Edited by: 840515 on Feb 28, 2011 10:00 PM

    Since the SP is on connection pool (and looks like expecting a input value), that may causing for error.
    Column in the report, pass PS variable and hide it if it not required in the report.
    Pls mark if helps

  • How to call the java method in java script function in a portal application

    Hi Friends,
    I am developing one application where i need to fetch the data from KM content and displaying it on the screen in regular interval. I wrote one method in JSPdynpage for fetching data from KM content now I need to call that java method in java script function.
    java method(IComponentRequest request)
    //Coode for fetching the KM content
    function()
    <b>//Need to call the java method</b>
    setTimeout(function, 5000);//setting the time interval for this function
    <<htmlb display code>>
    If anybody can help me in calling the java method in java script function that will be very helpful for me.
    Thanks in advance,
    Sandeep Bonam

    Hi,
    Pls see if the following links could help.
    http://www.rgagnon.com/javadetails/java-0170.html
    http://www-128.ibm.com/developerworks/library/wa-resc/?dwzone=web
    Regards

  • Calling java script from link

    Hi,
    I have a link on the page, when i click on the link i should call java script. Java script is written on page level edit area as HTML text.
    Can you give me the syntax ? how to call that script

    say you had a javascript function defined on or accessible to your current page that looked like this...
    function popupURL(url)
    {w = open(url,"winLov","Scrollbars=1,resizable=1,width=800,height=600");
    if (w.opener == null)
    w.opener = self;
    w.focus();}
    ...you could then call it with a link that looked like this...
    &lt;a href="javascript:popupURL('http://www.google.com');"&gt;Open Google in Another Window&lt;/a&gt;
    ...hope this helps,
    raj

  • Java/java script auto generate END Date

    Hi,
    I have a jps page with 4 fields.
    1. drop down list
    2. text box
    3. start date
    4. end date
    the problem is
    text box will allow "number of days"
    start date will get date from user on popup window
    end date has to be generate based on text box value "no of days", another filed which will retrieve from db and start date
    ex:
    if text box values is <50 and start date (user selected date) is 02-04-2010 , the end date should add 8 days from the start date.
    now the problem is calculating end date based on the start date with no of days which is given by user.
    i have spend time to write java script, but i am not able to complete the entire logic.
    please give some idea whether it can perform by java script or java bean.
    Thanks,
    Jasmin Rosline

    now the problem is calculating end date based on the start date with no of days which is given by user.
    Use the following code if you want to calculate in client side;
    <html>
    <script>
    function addVal(){
    var d = new Date(document.getElementById('dt').value);
    d.setDate(d.getDate() +eval(document.getElementById('dd').value));
    document.getElementById('result').value = (d.getMonth() +1) +"/"  + d.getDate() + "/" + d.getFullYear(); }
    </script>
    <body>
    <input type="text" id="dt" value="02/03/2011"/><br>
    <input type="text" id="dd"/><br>
    <input type="text" id="result"><br>
    <input type="button" value="add" onclick="addVal()"/>
    </body>Edited by: Pandiya on Feb 3, 2011 11:31 PM

  • Performance of Java Swing Vs Ajax ( Java Script )

    We had developed application in swing which displays the data received after querying to web-service in Table and JTrees.
    The current technological move is toward Ajax, It is ok that I can build this application in Ajax but not willing to go for replacment to swing.
    I had following question, why should I go for Ajax over swing considering my type of application only ( beside plugins,JRE.. )?
    And Peformance of Java script ( AJAX ) application over swing on following gorund?
    1. Rendering of components in Swing & HTML ( browser )
    2. Peformance of Java Script over Java ( CPU, Memory usage )
    3. Event model in Java Script over java swing
    4. Multitasking & Multithreading.
    5. Storing data in variables.

    The advantage of AJAX over Swing is clear, no special software is needed on a client computer other than an up to date browser.
    Swing does have some advantages however in that it is much more established and there are many more tools available for developing a front end GUI application in Swing.
    I have yet to find what I consider a "good" IDE for Javascript development on multiple platforms, Eg. IE, Firefox, etc...
    Javascript is also not truly object oriented and that makes organizing your code and your design harder.
    Performance I feel is a moot point between the two as it would hardly be noticeable, however I would guess that Javascript might have less performance than Java.

  • How to pass values to variables in WAD 7.0 using java script

    Hi.,
    My requirement is based on WAD 7.0.
    The sales value has to displayed in WAD using graph with various chart types.
    I have created variables for plant and material group in a query.
    I have created drop down box for plant with all plants in it, check box for material group and a Submit button in WAD in FORM tag of HTML coding.
    Once all the values are set in drop down box, checkbox and if the user clicks on submit button, the values has to captured by the variables for which I have created and the graph has to be aligned to the new values in variables.
    Kindly help me how to use java script to get the values from FORM and pass it to variables.
    Regards,
    Selva

    Hi Selva,
    You do not need to use Javascript for this. Instead you can achieve this by using API Commands in WAD 7.0.
    Please configure Action on the ButtonGroup webitem to use 'Commands'.
    ->Choose Command 'Set Variables Values / SET_VARIABLES_STATE' under Commands for Web Templates
    ->Set Display Variable Screen setting to OFF
    ->Choose Query Variable for Plant, Select Variable Type as 'Binding Type', Binding Type as 'Data Provider Selection', Data Provider as the one you have assigned to the Dropdown webitem, Characteristic as 0PLANT or as that assigned to the Dropdown webitem
    ->Repeat above steps for Query Variable Material Group
    Now when you make a selection from the Dropdown webitems, the Chart output will change accordingly. Let me know if this helps.
    --Priya

  • Pass in date from shell script to java program

    Hi,
    I need to pass in some parameter to my java program.
    eg 'java SomeProgram yyyy mm dd hh mm ss'
    How do i use the shell script to generate the valeus for the year, mth day etc?
    The program is running once everyday.
    I tried $argu0 = `date+%y`
    java SomeProgram $argu0
    but not working... thanks for your help!

    Then, why would you want to use 'date' to provide
    'now' to a Java program when you could just use new
    java.util.Date() which probably makes the same call
    as the Unix 'date' command?That works until you need to use a date other than 'now.'
        public static final String ISO_DATE = "yyyy-MM-dd HH:mm:ss";
        public static void main(String[] args) {
            SimpleDateFormat sdf = (SimpleDateFormat) SimpleDateFormat
                    .getDateTimeInstance();
            sdf.applyPattern(ISO_DATE);
            try {
                Date d = sdf.parse(args[0]);
                // rest of code here
            } catch (ParseException e) {
                // handle exception
        }Users will have to enclose there input with quotes otherwise the JVM will consider their input as two parameters, or you can change the pattern to include a character between dd and HH.

  • Passing array to java script

    How can i pass an array to a java script function??

    <html>
    <head>
    <script>
    <%
    String[] myArray = new String[2];
    myArray[0] = "hello";
    myArray[1] = "hello again";
    %>
    function showArray(){
    <%
    for(int i = 0; i < myArray.length; i++){
    %>
    alert("<%= myArray[i] %>");
    <%
    }//end for
    %>
    }//end showArray
    </script>
    <body onLoad="showArray()">
    </body>
    </html>

  • Passing importing parameter in  ABAP to  java script variable

    Hi Experts,
    I am calling a ABAP function module in javascript.Now how can I take importing parameter in  ABAP to java script variable. Because I need to give alert using the improting Paramter value...
    Thanks in advance..
    RR

    to pass ABAP variable value to javascript variable the syntax is
    var myjsvariable = "<%=abapvariable%>";
    Edited by: Durairaj Athavan Raja on Jul 29, 2009 2:39 PM

  • Passing password from shell script to Java

    Hi there,
    I have a shell script which has user id and password stored in variables. I call a java program from this shell script. I tried accessing this environment variable from java using system.getproperty and java is not getting the values. I have used export USERID PASSWORD
    and java classname to call it.
    I do not want to pass it as arguments because of security reasons. can anybody help me please.
    Thanks a bunch.

    Hi there,
    I have a shell script which has user id and
    password stored in variables. I call a javaprogram
    from this shell script. I tried accessing this
    environment variable from java using
    system.getproperty and java is not getting the
    values. I have used export USERID PASSWORD
    nd java classname to call it.
    Presumably you are using one of the newer java
    versions.
    Questions
    1. What statements are you using to set, export and
    run java?
    2. What shell are you using?
    3. How are you accessing the vars in java?
    I do not want to pass it as arguments because of
    security reasons. can anybody help me please.
    That is nonsensical. Putting it in env vars exposes
    it more than passing it as args.Thanks for replying jschell.
    1. I am using newer version java 1.5
    2. shell scripts gets it's variables from oracle reports through webservices.
    3. to run java i use java javaclassname3. I used EXPORT variablename and in java called system.getproperty(variablename)But system.getproperty is getting a null.
    And the decision about not passing it as args was made by our client. They think it's not safe to pass password.
    are they wrong??
    Please help me.

Maybe you are looking for

  • Sale order_Variant configuration

    Dear Experts, We have created a sale order for a configurable material  'CM' . It has 10 line items all with the same material 'CM'. The strategy type and group for the material ' CM' is Y5 ( Make to order production)  with customer requirement type

  • Calculations Translation- Bex vs Transformation

    Hello gurus, here is the line that I d like to translate in BW, and I d like to know what's the better way of implementing it in BW, is it in Transformation (formula/calculation), or in Bex. result = (1/3) x (sum of prior 3 month balance from date en

  • Problems Connecting to the Internet

    Please bear with me I am new to Cisco Routers. Back Ground: Small company that has 2 public IP addesses. The company has 2 buiildings across the street from each other and no way to directly connect them together. Currently the company has 2 NetGear

  • Best photo scanner for MacBookk and iPhoto 6?

    My winter project is to scan my old photos. Which scanner do folks recommend? I will mainly be scanning color photos? Thank you!

  • Anyone know the name of the site for guest maps, comments, etc?

    Hi, Does anyone know the name of the site that has lots of iWeb things, they have many kinds of guest maps, sunlit earth maps, comments you can add to iWeb, etc. They had lots of cool things and I can't find them. All help appreciated. Thanks, Todd