Help on JSP Function

Hi,
I am writing follow. java function inside my JSP
<jsp:useBean
     id="inquiryBean" class = "com.bbh.actionworld.pagingcontrol.inquiry.Inquiry" scope = "session">
</jsp:useBean>
<%
     int sIndex = inquiryBean.getStartIndex();
     int eIndex = inquiryBean.getEndIndex();
     int pSize = inquiryBean.getPageSize();
     out.println("sIndex= " + sIndex + "eIndex = " + eIndex + "pSize = " + pSize);
%>
<%!
void getNextRecords() {
if (sIndex == 0)
if ((sIndex > 0) && (sIndex < dataArray.length))
sIndex = eIndex;
eIndex = sIndex + pSize;
out.println("after next sIndex = " + sIndex + "eIndex = " + eIndex + "pSize = " + pSize);
inquiryBean.setStartIndex(sIndex);
inquiryBean.setEndIndex(eIndex);
%>
I'm getting errors like sIndex, eIndex , pSize ,out , inquiryBean are undefined variables in function.
Can anybody help me ?
Thanx in advance.
-Priya

do the three variables have local scope.
i.e have you declared them within a block and are trying
to use outside that block , if so they no longer exist in
memory.
just a guess.

Similar Messages

  • 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

  • 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.

  • How to use session variable in JSP function  & How to use both JSP  Servlet

    Hi,
    I am new to JSP and servlets
    Still I am devloping a website in JSP. I am not mixing JSP with servlets, but I do create Java files for bean, logic and database works.
    I try to keep the hard coding part out of JSP.
    I dont how to use both JSP and Servlets in combination.
    Hence If needed I write some functions in JSP.
    but it gives me error
    +<%! public void abc()+
    +{+
    int intUserId = Integer.valueOf((Integer) session.getAttribute("MySession_UserID"));
    +}+
    +%>+
    Saying cannot find symbol session
    1) So can u please tell how can I access session variables within JSP function
    2) And also give me some links/tutorials about useing both JSP and Servlets in combination.
    Thanks
    Venkat

    The application architecture when you use Servlets and JSP in a standard MVC pattern is explained here (under the heading "Integrating Servlets and JSP Pages") and here ...

  • How to use sswa jsp function in personalization?

    I have a question. When I add a custom item of type link in a region using personalization, how can i access the click of the link as an event in that region';s controller.
    Also if I want to use the "destination function" field of the new Link created with an existing seeded SSWA JSP function, how do i pass url parameter values to this function.
    The function name is IMC_NG_PER_SOURCE_VIEW and the HTML call is OA.jsp?page=/oracle/apps/imc/ocong/mosr/webui/ImcPerMosrViewPage&ImcPartyId={@ImcPartyId}&ImcPartyName={@ImcPartyName}&ImcMainPartyId={@ImcMainPartyId}
    Now when I click the link on the Page the HTML call is made as is, i.e. the target Page ImcPerMosrViewPage gets the value for ImcPartyId = "{@ImcPartyId}" instead of the real Party ID.
    Whereas on the same Page there is a side bar Menu, and one of the Menu item makes a call to the same sswa jsp function and when we click the menu item the target page is rendered successfully.
    So my question is how do I make the link on the region to work the same way as the Menu item.
    It would be great of you could share some tips to resolve this issue of mine.
    Many Thanks!
    Jay

    Just set the fire Action property of that link and capture that in controller PFR.
    Thanks
    --Anil                                                                                                                                                                                                           

  • To upload a data into SAP Table with the help of RFC function in BODS

    Hi,
    Please provide me step-by-step solution to upload data into any SAP table with the help of RFC function in Data Services.
    I have created RFC function that upload data into SAP table. RFC Function contains one table that has same structure as my database table.
    In the data services how can i filled the table of RFC function, i am using this function in query transform of data services but it gives me error.
    I am also follow link http://wiki.sdn.sap.com/wiki/display/BOBJ/BusinessObjectsDataServicesTipsand+Tricks
    but it did not help me.
    Thanks,
    Abhishek

    Hi Abhishek,
    Did you import the function module in the SAP datastore first? When you open the SAP datastore, the function should be listed in the 'functions' section. If not, import it. Make sure your function is remote executable.
    Once the function is there, you can use it in a transformation. In 'Schema Out' right-click on 'Query' (top level) and choose 'New Function Call'. You can then select a datastore and a function in the datastore. The wizard will show you which output parameters are available. I believe you have to add at least one and can select as many as you like.
    After confirming your selection the function and the output parameters appear in Schema Out. You can then right-click on the function and choose 'Modify function call'. A popup will appear where you can specify the input parameters.
    I hope this helps.
    Jan.

  • Calling out.println in a jsp function

    Hi, i want to call out.println in a jsp function. That is i am using function like this
    <%!
    void MyFunction()
    out.println("this is good");
    %>
    This code fails with error message: "out cannot be resolved"
    Also i don't want to return value from the function, since i will later call this function recursive and display value at each instant.
    Please suggest any solution.

    <%!
    void MyFunction(JSPWriter out)
    out.println("this is good");
    %>and then execute it with:
    <% MyFunction(out): %>

  • Help with stored function

    Hi...I was wondering if I could get help with this function. How do i write a function to return hours between a begin date and an end date for an employee. Thanks so much

    EdStevens wrote:
    AlexeyDev wrote:
    sb92075 wrote:
    select (date2-date1)*24 from dual;not as above but as below
    select (date2-date1)/24 from dual;date2-date1 is amount of days. Divide it by 24 and what? if you multiply it on 24 you will have a chance to know how many hours between these two dates. :-)Don't forget that a DATE type also includes a time component.I suppose it doesn't matter if you did a difference between two dates. The result is always number of days.

  • How to call a Search help in a function module?

    Hi Experts,
    I am a novice to ABAP, I am working on search helps. My requirement is to call a search help in a function module.
    Can anyone  please throw some light on this.
    Any inputs will be helpful.
    Thanks,
    Amita

    yes you can do that..
    in side the source code ..
    write the select statement according to requirement and pass the internal table to below function moduel and return field to yor help field..
    call the below fm inside the function module..
    'POPUP_WITH_TABLE_DISPLAY' or 'REUSE_ALV_POPUP_TO_SELECT'
    see the sample code...
    FUNCTION Z_MFG_PLANTS_F4 .
    "*"Local Interface:
    "  IMPORTING
    "     REFERENCE(W_WERKS) TYPE WERKS OPTIONAL
    "  IMPORTING
    "      REFERENCE(W_MATNR)    TYPE MANTR OPTIONAL
    Alv popup display
    DATA : gc_selfield     TYPE slis_selfield,
           gt_fieldcat_drd TYPE slis_t_fieldcat_alv WITH HEADER LINE.
    p_werks = W_WERKS.
    data : begin of t_marc occurs 0,
                werks type werks,
                matnr type matnr,
            end of t_marc
    select matnr werks from marc into table t_marc where werks = p_werks.
      IF t_disp[] IS NOT INITIAL.
      gt_fieldcat_drd-seltext_m = 'Material'.
      gt_fieldcat_drd-fieldname = 'MATNR'.
      APPEND gt_fieldcat_drd.
      CLEAR : gt_fieldcat_drd.
      gt_fieldcat_drd-seltext_m = 'WERKS'.
      gt_fieldcat_drd-fieldname = ''WERKS'.
      APPEND gt_fieldcat_drd.
      CLEAR : gt_fieldcat_drd.
    Allow the user to select the required plant
      CALL FUNCTION 'REUSE_ALV_POPUP_TO_SELECT'
        EXPORTING
          i_title               = 'Material Selection for Plant'
          i_selection           = 'X'
          i_screen_start_column = 5
          i_screen_start_line   = 5
          i_screen_end_column   = 70
          i_screen_end_line     = 20
          i_tabname             = 'T_MARC'
          it_fieldcat           = gt_fieldcat_drd[]
        IMPORTING
          es_selfield           = gc_selfield
        TABLES
          t_outtab              = t_MARC
        EXCEPTIONS
          program_error         = 1
          OTHERS                = 2.
      IF sy-subrc  0.
      ENDIF.
      READ TABLE t_MARC INDEX gc_selfield-tabindex.
      IF sy-subrc = 0.
            w_matnr = t_matnr-matnr.
      ENDIF.
    ENDIF.
    ENDFUNCTION.
    rgrds,
    Shweta

  • Hi @include in a JSP function

    Hi,
    I wanted to use the @include directive in a jsp function. But when I compile it I get errors.
    Is this allowed ?
    <%!
    private boolean isDisplayAllowed () {
    %>
    <%@include file="foo.inc"%>
    <%@include file="bar.inc"%>
    <%
    %>
    Thanks
    RT

    Thanks
    I have a code that is needed to be shared between multiple jsp files. So I moved them to an inc, file so as to share between multiple files.
    Now I need to use this in jsp functions, so I am not sure how to do this.
    If instead of using include approach if there is any other way to share the code, please let me know.
    Thanks
    RT

  • Requried Help in creating function

    Hi All,
    i need one help in creating function my input parameters for that function will be 1 or 1,2 or 1,2,3
    my output should be
    If i pass as 1 as input parameter it should return 1
    If i pass 1,2 as input parameter it should return 1,2 in different rows
    Similarly If i pass 1,2,3 as input parameter it should return 1,2,3 in different rows.
    Can any one please help me in creating this function.
    Thanks in Advance.
    Edited by: p78 on Jan 16, 2012 3:31 AM
    Edited by: p78 on Jan 16, 2012 3:31 AM

    Hi,
    that will be something like this. First you need a type for returning the rows (use other datatype for example number if you need so):
    CREATE OR REPLACE TYPE t_list AS TABLE OF VARCHAR2 (4000);
    /Then the function will be a pipelined function:
    CREATE OR REPLACE FUNCTION in_list (p_list  IN  VARCHAR2)
      RETURN t_list PIPELINED
    AS
      l_text  VARCHAR2(32767) := p_list || ',';
      l_idx   NUMBER;
    BEGIN
      LOOP
        l_idx := INSTR(l_text, ',');
        EXIT WHEN NVL(l_idx, 0) = 0;
        PIPE ROW (TRIM(SUBSTR(l_text, 1, l_idx - 1)));
        l_text := SUBSTR(l_text, l_idx + 1);
      END LOOP;
      RETURN;
    END;
    /now you can query (or whatever the needs are):
    select * from table(in_list('aa','bb'));Herald ten Dam
    http://htendam.wordpress.com

  • Java.lang.Error: IP Helper Library GetIfTable function failed

    Some of our users are sometimes getting the following exception:
    java.lang.Error: IP Helper Library GetIfTable function failed
    java.net.NetworkInterface.getAll(Native Method)
    java.net.NetworkInterface.getNetworkInterfaces(Unknown Source)
    Does anyone know why this happens and what can be done against it?
    Is this a bug?

    The operating system is     Windows XP, Java is version 1.6.0_03 Sun Microsystems Inc.
    Today, I got another error report containing this error. They all seem to come from the same user. Given that the user is still using our product, I guess it doesn't happen every time. :) The error actually happens in a third party library that uses JNI, so it could also be possible that this library messes up something. Given that the error happens rather rarely and we haven't got much data, I guess it isn't worth investigating this further at the moment.

  • How to get context sensitive help  in JSP Pages

    Is it possible to display context sensitive help in JSP Pages when I press the tab key on the keyboard base on the key focus. I don�t want to use any applet or Swing components, because it�s a web page viewed on the browser
    Thanks

    Java code inside a JSP is interpreted on the server and the HTML produced by the server it is shown in the client browser. The JSP code can incorporate calls to the JavaHelp API if it is available to the server. Those calls can be used on the server side to map parts of the JSP to contents of a help set (HTML pages).
    Given that, you can provide context sensitive help, but when it comes to view help information, you either can show HTML only (without TOC, index, etc.) or you'd need an applet.
    Ulrich

  • How to refresh a "SSWA jsp function" ?

    Dear all:
    I change sth in a package "HR_LOA_SS" (the package is "SSWA jsp function" ). What steps should I do to relink the package than make it available?
    Regards
    Edited by: Terry Chen on 2009/12/14 下午 11:06

    Hi,
    Submit "Compile Security" concurrent program from System Administrator responsibility and check then. Bouncing Apache is not required, but you may need to do so in case you cannot see the updated code.
    Regards,
    Hussein

  • How to call a jsp function on a java script event 'onchange'

    hi all,
    i m in trouble, iwant to call a jsp function on occurance
    of a javascript event onchange
    actully i want to refresh my one text field at every change
    in a select option of a form
    plz tel me any othr method if i m wrong.
    thnx in adv.

    as the form submition is a POST operation u can use some
    if{} else{} construct to handle this. u can check the value of some POST variable to identify whether its the first loading or refresh. got it
    regards
    aleens

Maybe you are looking for

  • Not able to use Commit after the function module STATUS_OBJECT_CREATE

    I am using function module   STATUS_OBJECT_CREATE    CALL FUNCTION 'STATUS_OBJECT_CREATE'           EXPORTING            CHGKZ         = 'X'            CLIENT        = SY-MANDT             OBJNR         = LV_OBJNR3             OBTYP         = 'IWE'  

  • Slow Moving Inventory Report

    Hi All, I am trying to generate a slow moving inventory query for materials that are not consumed for a certain period of time. I am using SAP B1 2007 A. Kindly share with me the ideas on how to generate the above query. Thanks. Best Regards, xavier

  • Send report in HTML format not in MHTML

    Hi all, I need to send report in email in HTML format not in MHTML format. Kindly help me. Thanks

  • Validate INPUT TEXT

    Hi there, Anybody can help me,just I have a page with 3 numeric field and I need to validate these field, the idea is accept only numeric input, how can I do this?

  • Adobe CS 5.5 for Mac 10.6.8 still available and supported?

    I have a 2007 white Mac (Macbook 2,1 -- snow leopard) that will support only up to CS5.  I need to learn photoshop, illustrator and indesign, so my options are 1) buy a new Mac or 2) buy CS5.  Any other thoughts as to why I should go one way or the o