Calling function of JavaScript from  jsp code

I ve to call one jsp page from other so I need to call another page
I m trying to do by writing a javascript code for submitting the page

while redirecting the page when I am using
request.getParameter of hidden objects in the
previous page its not giving the correct valuesA redirect is different from a submit, in the sense that it will create a new Request object.
If you want to pass parameters to the next page, you will have to pass them as part of the url:
response.sendRedirect("http://myserver/mypage.jsp?param1=value1&param2=value2");And then in mypage.jsp, you can do:
String value1 = request.getParameter("param1");

Similar Messages

  • How can I reach Javascript from JSP code blog?

    <script>
    var name2; // want to reach the data which in JSP code blog
    </script>
    <body>
    <%
    String name; // a data from database
    %>
    </body>Simply I want to reach "*name*" valuable from Javascript..
    I'll be happy if someone helps me..
    Thanx in advance..
    Talha

    Just print it out as a Javascript variable. Carefully read this: [http://balusc.blogspot.com/2009/05/javajspjsf-and-javascript.html].

  • Calling (VB)activex object from JSP

    Hi,
    I am trying to call a ActiveX object from JSP using the ActiveXObject method in javascript. I have a dll filed named LPMSFunctions.dll which is registered and is being passed as an argument to the ActiveXObject method. Below is the code i am trying to execute..
    <html>
    <head>
    <title>Script Example</title>
    </head>
    <body>
    <br><br>
    <P align="center">
    <form action="" method="post">
    <script language="JavaScript">
    function comEventOccured()
    try{
    var myobject;
    myobject = new ActiveXObject("LPMSFunctions72.LPFunctions72");
    alert("Inside LPMSFunction72");
    alert(myobject.GetDocPath());
    catch(e)
    alert("Error");
    </script>
    </form>
    </body>
    </html>When i write the above code and save it as an html file it works fine..the activex object is created and the methods are called , but when i copy the same code to a file and save it as jsp file under webapps folder under tomcat it doesnt work and reports a javascript error with the error being:
    Automation server cant create the object at line :
    var SSOObj = new ActiveXObject("LPMSFunctions72.LPFunctions72");
    Please suggest how can I solve the problem. Your help would be sincerely appreciated.
    Thanks
    shravan

    You want to use the Variant to Data node, wiring in an ActiveX constant configured to the interface type you want.
    Brian Tyler
    http://detritus.blogs.com/lycangeek

  • Calling custom OAF page from JSP page in Oracle apps

    Hi,
    I am working on a requirement to call a Custom OAF page from a JSP page in Oracle apps 11.5.10.
    I have registered the OAF page and defined a function for it. When we call this OAF page from JSP (without parameter), the page opens up
    URL: http://APPSURL:8020/OA_HTML/RF.jsp?function_id=27221&resp_id=50312&resp_appl_id=515&security_group_id=0&lang_code=US
    but as soon as I am trying to pass a parameter sr_id in the URL:
    http://APPSURL:8020/OA_HTML/RF.jsp?function_id=27221&resp_id=50312&resp_appl_id=515&security_group_id=0&lang_code=US&sr_id=106
    we are getting following error:
    You are trying to access a page that is no longer active.
    - The referring page may have come from a previous session. Please select Home to proceed.
    Please let me know if someone has faced the same problem...
    Thanks!!!

    Hi,
    Before calling a OAF page..from external JSP page...u need to set certain mandatory parameter like transaction Id and context.
    Regards,
    Gyan

  • Call of BW queries from ABAP code

    Has anybody information about how is it possible to call a BW query from ABAP code with parametrization (specifying characteristics) ? In our development project it's a crucial part, beacuse we have to provide interim function modules to carry out some conversion routine on BW provided data, before we put it on the screen embedded in a Visual composer Iview.

    Have a look at this:
    Calling BW queries programatically (also posted on BW forum)
    Hope it helps.
    Regards

  • [Tomcat bug?] Calling response.sendError(404) from JSP

    Calling "response.sendError(404);" from JSP context causes Tomcat to mangle all non-latin characters.
    Any ideas why?
    How to recreate bug:
    http://www.kitoy.ru/int/bug1.zip
    There are 3 files in bug1.zip.
    index..jsp:
    <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
    <%@page pageEncoding="utf-8"%>
    <%@page contentType="text/html; charset=utf-8"%>
    <%
        response.sendError(404);
    %>
    <html>
    </html>404.jsp:
    <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
    <%@page pageEncoding="utf-8"%>
    <%@page contentType="text/html; charset=utf-8"%>
    <html>
    <h1>Hello in Russian: &#1055;&#1088;&#1080;&#1074;&#1077;&#1090;!</h1>
    </html>and WEB-INF\web.xml:
    <?xml version="1.0" encoding="UTF-8"?>
    <!DOCTYPE web-app PUBLIC "-//Sun Microsystems, Inc.//DTD Web Application 2.3//EN" "http://java.sun.com/dtd/web-app_2_3.dtd">
    <web-app xmlns="http://java.sun.com/xml/ns/j2ee"
        xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
        xsi:schemaLocation="http://java.sun.com/xml/ns/j2ee http://java.sun.com/xml/ns/j2ee/web-app_2_4.xsd"
        version="2.4">
        <display-name>bug1</display-name>
        <description>bug1</description>
        <distributable/>
        <error-page>
            <error-code>404</error-code>
            <location>/404.jsp</location>
        </error-page>
    </web-app>Calling of index.jsp should cause 404 error with custom error page. The error page is utf-8 encoded and contains russian characters. That's by design.
    In fact, Tomcat shows ?????? instead Russian variant of "Hello".
    Tomcat/5.5.17 or Tomcat/5.0.28.- it does not matter.
    Is it Tomcat bug or I should not call response.sendError(404) from JSP?

    it's not a tomcat bug, it's rather a problem with
    your code.
    change index.jsp like the following then test
    it !
    <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01
    Transitional//EN"
    "http://www.w3.org/TR/html4/loose.dtd">
    <%@page pageEncoding="utf-8"%>
    <%@page contentType="text/html; charset=utf-8"%>
    <%
    esponse.sendRedirect("blablablablablabla.html");
    %>
    <html>
    </html>
    Thanks for the insight. But the issue here is with the response.sendError() method.

  • Call a Perl Script from JSP

    Hi guys,
    I am developing an online ticket booking system.
    i have come toa point where i need to call a perl script from JSP.
    please let me know how to do it.
    Basically, i need to call a function in perl script from JSP in order to encrypt my information.
    Any help is appreciated.
    Thanks in advance.
    Chintan Shah

    I haven't done this myself, but it seems like it is possible in Tomcat.
    You can configure Tomcat to handle .cgi calls (it does this via a CGI servlet)
    http://www.ftponline.com/javapro/2003_03/online/perl_teden_03_18_03/
    http://tomcat.apache.org/tomcat-5.0-doc/cgi-howto.html
    Once this is set up, theoretically you should be able to then use requestdispatcher and forward/include a cgi script to invoke the perl.
    I don't know if you are using Tomcat or not though... :-)

  • How to call a .bat file from java code?

    How to call a .bat file from java code? and how can i pass parameters to that .bat file?
    Thanks in advance

    thanks for ur reply
    but still i am getting the same error.
    I am trying to run a .bat file of together tool, my code looks like below
    import java.lang.Runtime;
    import java.lang.Process;
    import java.io.File;
    class SysCall{
         public static void main(String args[]){
              String cmd="D://Borland//Together6.2//bin//Together.bat -script:com.togethersoft.modules.qa.QA -metrics out:D://MySamples//Metrics// -fmt:html D://Borland//Together6.2//samples//java//CashSales//CashSales.tpr";
              //String path="D://Borland//Together6.2//bin//Together.bat ";
              Runtime r= Runtime.getRuntime(); //Declare the system call
              try{
                   System.out.println("Before batch is called");
                   Process p=r.exec(cmd);
                   System.out.println(" Exit value =" + p.exitValue());
                   System.out.println("After batch is called");
              /*can produce errors which must be caught*/
              catch(Exception e) {
                   e.printStackTrace();
                   System.out.println (e.toString());
    I am getting the below exception
    Before batch is called
    java.lang.IllegalThreadStateException: process has not exited
    at java.lang.Win32Process.exitValue(Native Method)
    at SysCall.main(SysCall.java:17)
    java.lang.IllegalThreadStateException: process has not exited

  • How to genarate javascript from jsp?

    how to genarate javascript from jsp?
    Edited by: coolsayan.2009 on May 12, 2009 6:21 AM

    coolsayan.2009 wrote:
    [got an example|http://www.ibm.com/developerworks/web/library/wa-aj-simplejava1/index.html] but can you say all this specifically because i am not familier with AJAX.and i want to generate a javascript random number and by jsp i want to send it to user email.once user got the number it will be checked wheather he got it or not in next page say check.jsp if it this entry is right he will be grant to access the his account....
    What does AJAX have to do with the rest of this question? And why do you want to generate a number in JavaScript at all? If you are trying to confirm a working email address, which is what I think you are trying to do then leave that all on the server side. Generate the number in the servlet, mail it, etc. Neither JavaScript nor AJAX are any part of that.

  • Call pl/sql API from jsp portlets

    HI ALL!
    I need to ask from java developers for portal application,How can i call pl/sql API from my jsp portlets,What enhancements in code should i have to follow in addition to use JDBC,I read in FAQ abt portal some thing abt pl/sql wrapper but that was for complex scenarios ,what if my requirement is to call only API functions for contentareas,items,previleges etc.I really need help.
    thx
    Alizeh

    Hi
    thanks for ur reply but where were u a month ago,i really started to think that my question was enough stupid not to be answered.At present i have done with jdbc and pl/sql calls ,current concern is for sessions as i see that session id remains same when one user logs out and another logs in(if browser is not closed), same sessionid persists in my java portlet for both users.Is this an expected behaviour?? but yes new session id appears if browser is closed.
    .session clear for both application and sso after logout is checked
    .broser is set to check for new version each visit for the page
    portal version is 3.0.9.8.0 ,we r planning patch to 3.0.9.8.3 soon
    once again thx
    Alizeh

  • Calling abap rfc FM from jsp programming

    hi friends,
        I am having a requirement to call abap function module from jsp page. can any one help me please?
    thanks
    Medoyi C

    Hi Medoyi,
    Please follow the below steps
    1. Are you using NWDS or any other IDE? Create your Web Project.
    2. In any of the case download JCO3.0 jar files and add to these librarries to you IDE.
    3. Create a connection class in write a code here and you should have host, port and userid/password of the ECC system from where you are calling your RFC.
    4. After making a connection then write a code to pass import parameters and execute.
    5. After execution of RFC you will get export parameter, table or structure.
    6. Display this data now as a respose.
    Please reply back if any more information is required.
    Thanks,
    Hamendra

  • Access function module string from JSP file

    Hello,
    I an a Java person with very little knowledge of ABAP. I have a Function Module, which returns the String - Y_text with value "X" or "Y". Now, I want to use this "X" or "Y" in my JSP page. And based on the value do some things. Eg:
    If (Y_text == "X")
        "Value is X"
    How do I pick up the valus of Y_text from the function module?
    I know how to get the values from Extention Data like below, but this does not seem to be working in case of the String from function module.
    String Y_text = (String) userSessionData.getAttribute("Y_text");
    Kindly suggest.

    Hi Shaun,
    Check the below link, it discusses about calling function module from ISA. Its a nice beginner's tutorial
    by Sateesh. You can copy the code given in ZAction.java in your jsp and get the values from FM.
    http://sites.google.com/site/sateeshchandrach2/isa2
    Hope this helps you!
    Regards,
    Arshi

  • How to call Generic Page flow from jsp

    Hi All,
    I have some links in my home page(jsp file).Based on user's selection, i need to show another JSP page using pageflow(JPF).
    thanks in advance
    vandana

    i have function created by java script lets say x and i want to call this function from jsp scriplet tag which is at the same page ..thanks

  • Calling my Java class from JSP page

    Hello, I am trying to call my Java class from my JSP page passing parameters to it and getting back a collection of result sets. Can someone tell me what I might be doing wrong:
    JSP code to call Java class:
    <%
    String strEssUser = "test";
    String strProcessingMonth = "JUL";
    String strProcessingYear = "2002";
    strQueryList=new ListReturn(strEssUser.toString(), strProcessingMonth.toString(), strProcessingYear.toString());
    %>
    I get this error when I try to run this JSP page using tomcat:
    C:\Program Files\Apache Tomcat 4.0\work\Standalone\localhost\em\jsp\Test_0005fSummarySBU_0005fscreen$jsp.java:77: Class org.apache.jsp.ListReturn not found.
    strQueryList=new ListReturn(strEssUser.toString(), strProcessingMonth.toString(), strProcessingYear.toString());
    I'm not sure if this problem is the way I am calling the Java class, or if I have a problem in the Java code itself. Can anyone help?

    Ok, I get a very strange error now:
    org.apache.jasper.JasperException: Unable to compile class for JSPerror: An error has occurred in the compiler; please file a bug report (http://java.sun.com/cgi-bin/bugreport.cgi).
    What is this??? Anyone?

  • How to Call Total Amount field from t.code - PC00_M40_ANN in driver program

    Hi,
    There is a standard Transaction for Payroll Annual display - PC00_M40_ANN. From this transaction we can see the Pension Amount month wise and in Totals as well as.
    In my report, we want to call Total Amount (from T.Code PC00_M40_ANN).
    For Ref., I have design a Smartform with its driver program. In driver program i required this Value...
    Plz guide..

    Hi,
        Please check the below code ....
        Declare variables , structures .....
      call function 'CU_READ_RGDIR'
        exporting
          persnr          = pernr-pernr  <--- pass the pernr
        importing
          molga           = w_molga
        tables
          in_rgdir        = itrgdir
        exceptions
          no_record_found = 1
          others          = 2.
      if not w_molga is initial.
        call function 'CD_READ_LAST'
          exporting
            begin_date      = pn-begda
            end_date        = pn-endda
          importing
            out_seqnr       = w_seqnr
          tables
            rgdir           = itrgdir
          exceptions
            no_record_found = 1
            others          = 2.
      endif.
      if itrgdir is initial.
        continue.
      else.
        select single relid from t500l into w_relid where molga = w_molga.
        call function 'PYXX_READ_PAYROLL_RESULT'
          exporting
            clusterid                    = w_relid
            employeenumber               = pernr-pernr
            sequencenumber               = w_seqnr
            read_only_international      = 'X'
          changing
            payroll_result               = itresult
          exceptions
            illegal_isocode_or_clusterid = 1
            error_generating_import      = 2
            import_mismatch_error        = 3
            subpool_dir_full             = 4
            no_read_authority            = 5
            no_record_found              = 6
            versions_do_not_match        = 7
            error_reading_archive        = 8
            error_reading_relid          = 9
            others                       = 10.
    get all the earnings and deductions
        loop at itresult-inter-rt into wa_rt.
          case wa_rt-lgart.
            to get the net pay
            when '/560'.
              wa_pernr-npay = wa_rt-betrg.
              v_npay = wa_rt-betrg.
           endcase.
    endloop.

Maybe you are looking for

  • If i update Itunes, do i have to re-add all the songs?

    If i update to the new version of itunes, do i have to readd all the songs? Just that i have changed the attributes of many of the songs (28GB in total) such as track names, album names and so on that would take me forever to re-do. Cheers Dave

  • Maximum is not populating in the output of bex query

    Hi friends, I calculated maximum value of a key figure restricting on char value. (Properties -> calculate Result as -> maximum ) But I am getting summation of maximum. for example. current-assigne open-cases    max-age-opencases. rock--10-- 75 charl

  • Musical notation in java

    My probelm is same, i want to display musical notations using java and jfugue. how to do that plz help if you know it. plz rply soon

  • FIDCC1 Validations / Substitutions and flat files?

    I am investigating the potential for two different types of functionality from using the FIDCC1 IDOC for transferring financial postings between two separate SAP FICO systems. My understanding at this point in time is that this IDOC won't perform any

  • Javascript problems after the update

    Ever since the latest software update on my Galaxy S3, I've been having problems with my internet.  I keep getting a message that I need to turn on JavaScript, but I already have JavaScript enabled in my browser.  I go into the settings, and then cli