Call jsp function in javascript without using Applet

anyone knows how to call jsp function in javascript .
just as follows:
<%!
public string jspcall()
return new String("just a example");
%>
<script language="javascript">
<!--
temp = jspcall();
//->
</script>
it's desn't work.
any suggestion will help!

it's was not able to call a jsp function in javascript.
jsp function was on server site while javascript normally on the client site.

Similar Messages

  • Swing components without using applets

    hi there
    can i display swing components on the browser without using applets through jsp.
    if the answer is yes.please help me by sending a sample code.thanking u.
    -radhakrishna

    A JSP is compiled into a (server-side, obviously) servlet, which responds to Http requests by constructing a String of HTML/JavaScript etc to send back to the browser which then displays it.
    A Swing component is a piece of Java. The only way for such a component to run on the client side is to use either Applets or the new Java WebStart technology (see the JDC), which allows you to run a Java App locally from a Web Browser.
    You cannot possible use JSP to view Swing Components, without also using either of the above.

  • Is there any way to display JTree without using applet

    Hi,
    is there any way to display JTree without using applet . Can we display the JTree in a JSP page.
    With Regards,
    Sheema.

    Not a JTree, per se. But there are Javascript solutions out there and there are JSP tag library solutions which use a JTree on the server side to hold and maintain the data and expanded nodes.
    This is one that I've used before, it's pretty good:
    http://www.jenkov.dk/treetag/introduction.tmpl

  • How to call java function in javascript

    Hello Everyone,
    Can anyone tell me solution that:
    How to call java function in javascript?
    Thanks,
    VIDs

    You can't since Java is running on the server and javascript is running in the browser long after the Java side of things has finished executing. Assuming you're not talking about an applet here.
    But you can make calls back to the server through Ajax. All you need is something like a servlet on the receiving end which you can invoke through Ajax; from that point you can execute any Java code you want.

  • How we can limit the number of concurrent calls to a WCF service without use the Singleton pattern or without do the change in BizTalk Configuration file?

    How can we send only one message to a WCF service at a time? How we can limit the number of concurrent calls to a WCF service without use the Singleton pattern or without do the change in BizTalk Configuration file? Can we do it by Host throttling?

    Hi Pawan,
    You need to use WCF-Custom adapter and add the ServiceThrottlingBehavior service behavior to a WCF-Custom Locations.
    ServiceThrottlingBehavior.MaxConcurrentCalls - Gets or sets a value that specifies the maximum number of messages actively processing across a ServiceHost. The MaxConcurrentCalls property specifies the maximum number of messages actively
    processing across a ServiceHost object. Each channel can have one pending message that does not count against the value of MaxConcurrentCalls until WCF begins to process it.
    Follow MSDN-
    http://msdn.microsoft.com/en-us/library/ee377035%28BTS.10%29.aspx
    http://msdn.microsoft.com/en-us/library/system.servicemodel.description.servicethrottlingbehavior.maxconcurrentcalls.aspx
    I hope this helps.
    Rachit
    If this answers your question please mark it accordingly. If this post is helpful, please vote as helpful by clicking the upward arrow mark next to my reply.

  • How to call session directly in bdc without using SM35

    how to call session directly in bdc without using SM35

    HI
    good
    you r using the sm35 to see the session for calling teh session in your report
    ATA:   messtab LIKE bdcmsgcoll OCCURS 0 WITH HEADER LINE ,
    c_session  LIKE   apqi-groupid VALUE 'Z3PL_CUST' ,
    c_job      LIKE   tbtcjob-jobname VALUE 'Z3PL_JOB_CUST' ,
    c_flag     TYPE    c VALUE 'X'  ,
    g_qid      TYPE apqi-qid      .
    thanks
    mrutyun

  • How can I assign 'Call Contact' in Reminders app without using Siri for it?

    Hi!
    Just like the title states, I was wondering how can I assign a click to call a contact in Reminders without using Siri for it.
    When I enter a reminder "Call mom" for instance (in the Reminders app), it does not sync with the same contact in my Contact list (for Click to Call), but it does when I use Siri for it. Anyway to resolve that?
    Thanks in advance.

    Hi,
    If the config the the module you are using doesn't support a certain type of form them you have two options;
    - Take a copy of the print program and change it to use the desired type of form
    - Create a type of form that is supported and use that to call your form.
    Regards,
    Nick

  • How to call JSP function from onClick Action

    Hi
    I am trying to call a jsp function, onclick of a checkbox. This jsp function will in turn connect to the database and gets related information. I dont want to submit the data inorder to avoid posting and getting of huge data. Is there a simple way to call a jsp function from the users onClick action.
    Appreciate anyones help!!!
    Thanks alot
    Joe

    So, i have to submit the form to call the jsp function. Basically yes.
    Sorry for the shortness of the answer, but I am pretty sure we have had this conversation (or one very much like it) before.
    Java/JSP runs on the server, generates an html page, and stops running.
    Javascript runs on the client in the web browser, once the page is loaded.
    You cannot call java code from javascript.
    The only way you can run java code again is to make a request - either by submitting a form, or clicking a link.
    If you don't want to refresh the current page, you CAN get tricky with javascript and multiple frames. You submit to another frame, and when it loads, it uses javascript onload event to call back and modify the main frame. Its tricky to get going, and very easy to break, so I don't normally recommend it.
    Good luck,
    evnafets

  • Help with calling java functions from javascript

    I am using javax.script to interpret javascript from a java applet. it loads the js file into a string, and then does engine.eval(script_string). My question is, how would I make functions in the class file that are available to javascript?
    Update: Instead of that, I am loading a js script that will contain all of the usable functions. Here it is:
    //core.js for Javasphere 0.31
    var pkgs = new JavaImporter(java.lang, java.lang.System, java.awt);
    with(pkgs) {
    function Abort(msg) {
            var graph = new Graphics();
            g = graph.getgraphics();
            g.drawString(msg, 20, 20);
    }When I do engine.eval("Abort(\"something\")"); it throws this error:
    javax.script.ScriptException: sun.org.mozilla.javascript.internal.EvaluatorException: error instantiating (0): class java.awt.Graphics is interface or abstract (<Unknown source>#8) in <Unknown source> at line number 8

    Eggbertx, let's start from scratch if you don't mind. Say you have this Applet
    pubic class MyApplet extends Applet
      String message;
      //CALL THIS METHOD FROM JAVASCRIPT
      public void setMessage(String msg)
        message = msg;
        // this saves you from having
        // to call getGraphics() from JavaScript
        repaint();
      public void paint(Graphics g)
        g.drawString(message, 10, 30);
    }Then in your HTML file you may have something like this:
    <input type="text" id="msg" value=""></input>
    <input type="button" value="Set Message" onclick="setAppletMessage()"></input>
    <applet id="myApplet" code="MyApplet.class" width="400" height="100"></applet>And in the JavaScript file:function setAppletMessage()
      var msg = document.getElementById("msg").value;
      document.myApplet.setMessage(msg);
    }This is about all you really need to do. See how the Graphics object is no longer in your .js file?
    Note: You may run into other difficulties in getting this code to work because of browser, security, or some other pain-in-the-neck issues, but this is the idea.
    Eggbertx, I see you added a star to my first post and I think you should take that off because:
    1. <tt>Component</tt> is abstract... so you can not call the <tt>new</tt> operator.
    2. The call <tt>component.getGraphics()</tt> is not going to work either, because <tt>component</tt> was never created.

  • Cannot call AS3 Function from JavaScript

    Hi,
    I am trying to call an ActionScript 3 function with JavaScript. The problem I cannot seem to get any of the browsers to trigger this AS3 function. The debuggers say that the function is undefined when I call it on the flash object. 
    What is supposed to happen is - the javascript function calls the AS3 function, and passes it an integer value.   That integer is then used to pull one of 20 swfs, and load that into the flash movie.
    Please let me know if you guys can think of anything that I can do to make this work!  I've been stuck for hours, and can't seem to make it happen.
    Here is my actionScript:
    import flash.net.URLRequest;
    import flash.display.Loader;
    import flash.external.ExternalInterface;
    var movies:Array = ["idle-ok.swf", "idle-good.swf"];
    // It first loads this "hello swf".
    var helloLoader:Loader = new Loader();
    var helloURL:URLRequest = new URLRequest("idleAvatar.swf");
    helloLoader.load(helloURL);
    addChild(helloLoader);
    var setAvatar:Function = loadAvatar;
    ExternalInterface.addCallback("callSetAvatar", setAvatar);
    // Then, this function should be called by JavaScript to load one of the other swfs.
    function loadAvatar(indx:Number){
        var url:URLRequest = new URLRequest(movies[0]);
        var ldr:Loader = new Loader();
        ldr.load(url);
        addChild(ldr);
    Here is my JavaScript:
    <script type="text/javascript">
    function callExternalInterface(val) {
              document.getElementById("loader").callSetValue(val);
    </script>
    Here is my embed code:
    <div>
    <object classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" width="250" height="350" id="loader" name="loader">
    <param name="movie" value="loader.swf" />
    <param name="allowscriptaccess" value="always" />
    <!--[if !IE]>-->
    <object type="application/x-shockwave-flash" data="loader.swf" width="250" height="350">
    <param name="allowscriptaccess" value="always" />
    <!--<![endif]-->
    <a href="http://www.adobe.com/go/getflashplayer">
    <img src="http://www.adobe.com/images/shared/download_buttons/get_flash_player.gif" alt="Get Adobe Flash player" />
    </a>
    <!--[if !IE]>-->
    </object>
    <!--<![endif]-->
    </object>
    </div>
    <a href="#" onClick="callExternalInterface(1)">CLICK</a>

    You don't appear to be calling any function in your actionscript.  The names between and within do not agree. 
    document.getElementById("loader").callSetValue(val);
    should be calling a function identified with the string "callSetValue" in your actionscript, but you only have a function identified with "callSetAvatar"  and the function associated with that on your AS3 side is specified to be setAvatar...
    ExternalInterface.addCallback("callSetAvatar", setAvatar);
    but you do not have a function named setAvatar, you have one named loadAvatar
    Here's a link to a tutorial that might help you to see how the functions are specified between javascript and actionscript using the ExternalInterface class.  It gets confusing so I suggest you copy the code to a word processing file so you can clearly highlight where they have the same language between them.
    http://viget.com/inspire/bi-directional-actionscript-javascript-communication

  • How do you call a function within a package using OCI in C

    I am trying to call a user-defined function in Oracle 8.1.7 using OCI in C. I am getting a ORA-06550 PLS-00221, <function name> is not a procedure or is undefined. Can anyone tell me how I would call a function using OCI?
    Thanks.

    I think I figured it out, but I am now getting a ORA-06512 error; numeric or value error: character string buffer too small.

  • Calling cvi functions from test stand using structs

    WE got some Issue regarding the process of calling cvi function using test stand

    I'm sorry to hear that you have some issues calling cvi functions. There is a shipping example that demonstrates how to call a CVI function and pass a structure. The example can be found in <TestStand>\Examples\StructPassing\C\Struct Passing to a C DLL.seq.
    If the example program does not resolve your issues, post again and please describe the problem in detail.
    Regards,
    Shannon R.
    Applications Engineer
    National Instruments

  • Calling jsp file from javascript function

    How can i call a jsp file itself from javascript function written in it?

    I do not think you can invoke the current jsp directly using javascript.
    If the effect you are trying to achieve is to reload the page, then you could execute the servlet / code which called the current jsp.

  • Without using applets geting the output into a javascript variable

    Hi,
    I'm not using executeCommand applets in my webpage,but with the url
    i'm running the transaction. I'm passing the url to iframe as a <b>src</b> in the same page itself. like
    <b>document.getElementById("<iframe>").src="http://localhost/Lighthammer/Runner?Transaction=<Transaction_Name>&<Input_params>=<value>&OutputParameter=*"</b>. It will take 10 seconds to execute the transaction and load into the iframe.
    So I'm giving the
    <b>SetTimeout("alert(document.getElementById('<iframe>').docuemnt.body.innerHTML",10000);</b>
    In the iframe i'm able to see the output as "<u>oktransaction executed</u>" in <u>xml format</u>.
    But in the alert I'm not able to see the same content. <i>In the alert I'm able to see</i>
    <u><iframe id="<id of iframe>" src="<Which i set in the script>"></iframe></u>
    Help me to get the OutputParameter value into a javascript variable.

    Rakesh,
    A couple of observations:
    1.  Why are you calling Runner directly?  You should be using an XacuteQuery template, and reference "/Lighthammer/Illuminator?QueryTemplate=Folder/TRX" syntax when changing the URL in the iFrame.
    2.  You are also using "localhost" which is not portable and may also be causing your problem since your parent page will be based upon the server path, whereas you are forcing the browser to load localhost content into the iFrame (which unless you are physically sitting on the xMII server itself will never work).
    Regards,
    Jeremy Good

  • Calling .jsx functions from .js files using HTML Widget

    Hi there,
    I'm using the HTML Widget in a panel to load an html file along with some javascript files. Is there a way to call .jsx Adobe functions from a .js file? I've successfully been able to call an alert() of a .jsx file from the html but have not been able to do anything further than that.
    For example:
    .js file:
    var x = foo('bar');
    alert(x);
    .jsx file:
    function foo(x) {
        alert('This works');
        var dir = $.fileName;
        alert('This doesn't work because of $.fileName');
        return 'Directory: ' + dir;}
    So, ultimately I would like to have an HTML Widget in my panel, press a link that will call fiddle with the open document and layer, then return some values back to the HTML Widget's js file.
    Thanks

    To the client browser, JSP is just HTML. Adding JS makes it DHTML, which provides the kind of applet/web page interaction you were referring to in the first post. Note that the applet and JS are both being run 'client side', whereas the JSP is generated 'server side'.
    A JSP environment can in some cases replace the JS (e.g. submit a form with values to the server, and use JSP to write the resulting applet page). This can be handy in the event that the end user does not have JS enabled, in that you can offer a 'pure HTML' solution. OTOH though, it is slower (requires a round trip to the server to do what the user asked for) and most users prefer the quicker 'click and see' philosophy of the Java/JS combo.
    So, my advice to you is that JSP adds very little value, here.

Maybe you are looking for