Using JSPs and passing data from 1 page to the next

I have an application which has a number of JSPs.
JSP1 has some fields and buttons.
One of these buttons is called 'Print'. On pressing this control
is passed to the next JSP2. In this JSP the data is displayed
from the database. It is displayed via some TABLE tags, thus giving
multiple records displayed. There is also a check box against each record and having checked this box - the user can then then press another button which takes the user to another JSP - JSP3 - which gives the user a list of options for printing. They then can do 1 of 2 things - print a report or print some labels.
I have got this to work where there is only 1 record displayed in JSP2.
But where more than one record is displayed in JSP2 - JSP3 does NOT
know how to handle this and says the variable is undefined.
The code I am using to reference the JSP2 variable is
var batchNumber = top.opener.document.printTranscript.batchNumber2.value;
Any help or ideas would really be appreciated.
Thanx
Chris

Hi
If you are using JavaScript, try putting data in a Hidden field and perform request.getParameter in the next page, Place data in a Delimited fashion when placing into the hidden field, on the next page split these values and place where you want them to be.
This is a proven method...
Thanks
Swaraj

Similar Messages

  • What are Parameters? How are they differenet from Variables? Why can't we use variables for passing data from one sequnece to another? What is the advantage of using Parameters instead of Variables?

    Hi All,
    I am new to TestStand. Still in the process of learning it.
    What are Parameters? How are they differenet from Variables? Why can't we use variables for passing data from one sequnece to another? What is the advantage of using Parameters instead of Variables?
    Thanks in advance,
    LaVIEWan
    Solved!
    Go to Solution.

    Hi,
    Using the Parameters is the correct method to pass data into and out of a sub sequence. You assign your data to be passed into or out of a Sequence when you are in the Edit Sequence Call dialog and in the Sequence Parameter list.
    Regards
    Ray Farmer

  • Issue in passing data from PAge A to Page B

    Hi
    I have a scenario where I am trying to pass data from Page A to Page B. This data has to
    be passed on the click of a button. On the button's event, I have set the paramaters that
    I want to pass. I have passed these params in a hashmap in pageContext.forwardImmediately
    method.
    Page A has the requisition records. Clicking the radio button against one of these
    records and clicking the Lines button should take me to Page B with that Requisition VO's
    Row.
    In Page B, there are 2 parts..
    (1) A header which displays the requisition details like Req Number, Current Version,
    Previous Version etc
    (2) A table (Advanced Table) regiion which displays the Line details per that Requisition
    (Each Requisiton has 'n' lines).
    I am also getting the paramater value(s) in Page B's controller's processRequest.
    Here, I am calling the init methods on both the requisitionsVO and the linesVO which calls the executeQuery() methods. I thought that this will populate the Page B as the VO's columns are mapped to the
    respective fields in the Page. But I am not able to see any data on Page B. Am I missign anything here.

    reinitlize the VO
    By this do you mean the following :
    In the Controller:
    String reqNum = (String)pageContext.getParameter(PoConstants.PO_REQUISITION_KEY);
    if(!PoUtils.isEmpty(reqNum)) {
    Serializable[] param = {reqNum};
    Class [] paramTypes = {reqNum.getClass()};
    am.invokeMethod("initPoReqHeadersQuery",param, paramTypes);
    In the AM:
    public void initPoReqHeadersQuery(String criteria)
    OADBTransaction txn = this.getOADBTransaction();
    if ( txn.isLoggingEnabled(oracle.apps.fnd.framework.OAFwkConstants.PROCEDURE))
    txn.writeDiagnostics(this, "initPoReqHeadersQuery.begin", oracle.apps.fnd.framework.OAFwkConstants.PROCEDURE);
    PoReqPendingForAcceptanceVOImpl vo = getPoReqPendingForAcceptanceVO1();
    vo.initReqQueryAction(criteria);
    if(!PoUtils.isEmpty(vo)) {
    PoReqPendingForAcceptanceVORowImpl row = (PoReqPendingForAcceptanceVORowImpl)vo.first();
    if(!PoUtils.isEmpty(row)) {
    vo.setCurrentRow(row);
    if ( txn.isLoggingEnabled(oracle.apps.fnd.framework.OAFwkConstants.PROCEDURE))
    txn.writeDiagnostics(this, "initPoReqHeadersQuery.end", oracle.apps.fnd.framework.OAFwkConstants.PROCEDURE);
    In the VO:
    public void initReqQueryAction(String criteria)
    OADBTransaction txn = (OADBTransaction)getApplicationModule().getTransaction() ;
    if ( txn.isLoggingEnabled(oracle.apps.fnd.framework.OAFwkConstants.PROCEDURE))
    txn.writeDiagnostics(this, "initReqQueryAction.begin", oracle.apps.fnd.framework.OAFwkConstants.PROCEDURE);
    setWhereClauseParams(null);
    setWhereClause(null);
    setWhereClause("SEGMENT1 = :1");
    setWhereClauseParam(0,criteria);
    executeQuery();
    if ( txn.isLoggingEnabled(oracle.apps.fnd.framework.OAFwkConstants.PROCEDURE))
    txn.writeDiagnostics(this, "initReqQueryAction.end", oracle.apps.fnd.framework.OAFwkConstants.PROCEDURE);
    }

  • How to use session to passing data from one JSP to another JSP

    Dear All, I had create 2 jsp web page and want to do this:
    1. input some data into the text box and click the submit button, the jsp page
    will open another jsp page and send the text box data to the new open jsp page.
    can any one tell me how to open a new jsp web page and reciev data from another jsp page?
    thanks yu very much!
    the question.jsp got some code like:
    <html>
    <input type= 'text' name = 'txtName' size = 10 >
    <input type= 'submit' name = 'submit'>
    <% some jsp code %>
    </html>
    answer.jsp
    <html>
    <%
    some jsp code here
    %>
    </html>

    Contents of HTML forms are transmitted as name-value pairs, so you can call request.getParameter(String name) with your form field's name in order to access its value:
    String textValue=request.getParameter("txtName");Regards

  • Passing data from page to page

    Hello,
    Firstly i will describe my website structure:
    On the first page i show two objects: table1 and textInput1. Table1 shows the list of data, and textInput1 - current row value.
    On the second page i show three objects: table2, textInput2 (does the same as textInput1), textInput1 (now it's a constant, showing chosen row in the first page).
    The third page consists of table3, textInput3, textInput2 and textInput1.
    And so on..
    And here is the question:
    where should i keep my current row value so i could reach it from all further pages
    or what is the best way to pass them?
    It would be perfect if anyone could provide some information sources (manuals/tutorials) related to this question.
    Thank you!

    Hello,
    If you are using a statefull application then the easiest way is to create a variable in the application class. Save the input from the view it this variable during handle_data en then in the page with flowlogic use application->name_variable to read it.
    An other way is to create a link to the page with flowlogic with after the link ?variable_name=value and in the page with flowlogic create a page attribute with the same name and turn on auto.
    With regards,
    Frank Roels

  • Passing data from page to page: clarification requested

    Hello,
    I found an old post by craig.mcc which suggests:
    "When using JavaServer Faces, your best design strategy is to pretend that there is no such thing as a URL -- that should be an invisible implementation detail, which merely adds complexity if you expose it. Instead, if you need to pass information from one page to another, you should store it as a request/session/application scope attribute (as appropriate) where the destination resource (the "LogIn.jsf" page in this case) can retrieve it via a value binding expression."
    Can anyone clarify "store it as a request/session/application scope attribute"? I'm just not entirely sure what he's referring to, or how it might look.
    Thanks,
    Ryan

    Ryan, here is what I did:
    (To use your example)
    <h:form>
    <h:command_link action="submit"
         actionListener="#{MyBean.commandListener}">
    <f:parameter name="param1" value="value1" />
    <f:parameter name="param2" value="value2" />
    </h:command_link>
    </h:form >
    The Backing Bean Method would look like:
    public void commandListener( ActionEvent evt ) {
    String param1, param2;
    UICommand command = (UICommand)evt.getComponent();
    List commandChildren = command.getChildren();
    for ( Iterator it = commandChildren.iterator(); it.hasNext(); ) {
    UIComponent child = (UIComponent) it.next();
    if ( child instanceof UIParameter ) {
    String parmName = (String) ( (UIParameter)child ).getName();
    String parmValue = (String) ( (UIParameter)child ).getValue();
    if ( parmName.equals("param1") )
    _param1 = parmValue;
    else if ( parmName.equals("param2") )
    _param2 = parmValue;
    } // end-of-for-loop     
    // Other processing on param1 and param2 ........
    And you would have a Navigation-rule that maps the action outcome of "submit" to "test.jsp".

  • JSP and passing data

    Currently when I write a JSP form page and submit that page I have it go to another page to process the inputed data. But when it does that it passes: http://blah/productUpdate.jsp?var1=1&var2=3 and so on.
    Is there another way to go about this and not having to pass the data in the address of the page?

    set the form method to post:
    <form methd="post" action=productUpdate.jsp>

  • Any info about ADF WebServices and pass data from one VO to another VO?

    Hi, i need to do a webservice for synchronize two tables in two db... there are any info, articles, tutorials or examples about this? preferably the part of data copying between VO...
    Thanks in advance.

    I'm not exactly sure what you are trying to do and why would you need a Web service for this - but it seems like having an AM service method is what you should be using.
    Read more here:
    http://docs.oracle.com/cd/E26098_01/web.1112/e16182/bcservices.htm#sm0206
    http://docs.oracle.com/cd/E26098_01/web.1112/e16182/bcservices.htm#sm0212
    Demo:
    https://blogs.oracle.com/shay/entry/am_service_method_-simpledem

  • Using forms6i and reading data from MS SQL server 7

    Hi!
    I have been given a new task to connect to Microsoft SQL SERVER 7 with Oracle 6/6i development with ODBC and extract specific data.
    I am realy stuck with this I hope some one will help me with this as soon as possible.
    thanka

    I did a similar thing with developer 2000 (Form 4.5) and SQL server6.5.
    There are lots of things involved and there will be issues that need to be resolved in you application but you can take one thing at a time and you should be able to do it.
    -First make sure that your SQL server is up and running.
    -Then make a client machine that connects to SQL server.
    -On the client install your Form6 or 6i.
    -Install ODBC manager on your Client Machine.
    -Get the Oracle ODBC driver for SQL server.
    -There is a document available with developer 2000 for open data source. It should be with your Form6/6i documentation. It has got a section for connection with SQL server.
    Start with this and where ever you get stuck ask away question on the forum.
    Hope this help

  • Passing data from apex to the conditions of a WHERE package

    Hi,
    I have a package that contains the following function for extracting data:
    function lavori return xmltype is
    xml_lavori xmltype;
    begin
    select xmlagg(xmlconcat(xmlelement("ss:Row",
    xmlelement("ss:Cell", xmlelement("ss:Data", XMLAttributes('String' as "ss:Type"), rownum)),
    xmlelement("ss:Cell", xmlelement("ss:Data", XMLAttributes('String' as "ss:Type"), IC_LAVORI.TIPOLAGIA_PRESTAZIONE)),
    xmlelement("ss:Cell", xmlelement("ss:Data", XMLAttributes('String' as "ss:Type"), IC_LAVORI.ID_LAVORO)),
    xmlelement("ss:Cell", xmlelement("ss:Data", XMLAttributes('String' as "ss:Type"), IC_LAVORI.DATA_ESECUZIONE_PRESTAZIONE)),
    sospensioni(IC_LAVORI.ID_LAVORO),appuntamenti(IC_LAVORI.ID_LAVORO))
    into xml_lavori
    from IC_LAVORI;
    return xml_lavori;
    end;
    I connected it to a page of Apex but I would like to add WHERE conditions for the parameters of my package that will pass through the filters on my page of APEX.
    A filter is the search in an interval of time and the objects that make the filters are ': P10_X_DA' and ': P10_X_AL' acting on the object DATA_ESECUZIONE_PRESTAZIONE
    how can I do to pass these parameters to the WHERE?
    Can you help me?
    thank you very much.
    Good day.

    Hi,
    really there is nobody able to help me?
    To be clear:
    I have a APEX report with one query specific consists of a WHERE whose conditions are managed by the filters of the report.
    Then I have a package that I am exporting data into Excel when I enter or the same conditions imposed in the report, or simply extract all the ID in the report.
    I hope I have been as clear as possible and that someone can help me.
    Thank you very much
    Edited by: DumboN2 on 16-dic-2009 12.32

  • Best way to control and read data from multiple instruments?

    Hello,
    I'm building an application to test power supplies involving multiple pieces of equipment over a couple of different comm busses. The application will also send control instructions to some of the instruments, and read data from some of the instruments. The reading and control profiles will not run on the same schedule (variable length control steps, configurable read interval).
    I was thinking of using a queued statemachine (producer/consumer) for the control profile and another to read the data, but I got concerned that there would be collisions between sending control commands and read commands to the same machine. Is there a suggested design pattern for implementing something like this?
    Timing of the commands isn't critical down to the milisecond, but I need to collect reasonably accurate timestamps when the data is read. The same is true for the control commands.
    Here are the instruments I'm going to use, if the are control, read, or both, and the communication method
    Instrument Funtions Comm Method
    Power Supply Read data Communicates to PMBus Adapter
    PMBus to USB Adapter Read data USB (Non-Visa)
    Switch control relays USB (VISA)
    Power Dist. Unit read data/control outlets SNMP (Ethernet)
    Electronic Load read data/control load GPIB (VISA)
    Thermal Chamber read data/control temp Ethernet (VISA)
    Thanks,
    Simon

    Hello, there is a template in LV called "Continuous measurement and Logging".
    It can give you some idea how to properly decouple the "GUI Event handler" top loop (where your Event structure is) from the DAQ and other loops.
    You do not need to totally replicate the above example, but you can find there nice tricks which can help you at certain points.
    The second loop from the top is the "UI message loop". It handles the commands coming from the top loop, and regarding to the local state machine and other possible conditions and states, it can command the other loops below.
    During normal run, the different instrument loops just do the data reading, but if you send a control command from the top loop to a certain instrument loop (use a separate Queue for every instrument loops), that loop will Dequeue the control command, execute it, and goes back to data reading mode (in data reading mode the loop Dequeu itself with a "data read" command automatically). In this way the control and data read modes happen in serial not in parallel which you want to avoid (but I think some instrument drivers can even handle parallel access, it will not happen in really parallel...).
    In every instrument loop when you read a value, attach a TimeStamp to it, and send this timestamp/value couple to the DataLogging loop via a Queue. You can use a cluster including 3 items: Source(instrument)/timestamp/value. All the instrument loops can use the same "Data logging" Queue. In the Datalogging while loop, after Dequeue-ing, you can Unbundle the cluster and save the timestamp and data-value into the required channel (different channel for every instrument) of a TDMS file.
    (Important: NEVER use 2 Event structures in the same top level "main" VI!)

  • Pass data from servlet to jsp using sendRedirect

    Hi,
    I am passing data from servlet to jsp using forward method of request dispatcher but as it doesn't change the url it is creating problems. When ever user refreshes the screen(browser refresh) it's re-loading both servlet and jsp, which i don't want to happen. I want only the jsp to be reloaded.
    Can I pass data from servlet to jsp using sendRedirect in this case. I also want to pass some values from servlet to jsp but without using query string. I want to set some attributes and send to jsp just like we do for forward method of request dispatcher.
    Is there any way i can send data using attributes(without using query string) using sendRedirect? Please let me know

    sendRedirect is meant as a true redirect. meaning
    you can use it to redirect to urls not in your
    context....with forward you couldn't pass information
    to jsps/servlets outside your own context.Actually, you can:
    getServletContext().getContext("/other").getRequestDispatcher("/path/to/servlet").forward(request, response)I think the issue here is that the OP would like to have RequestDispatcher.forward() also update the address in the client's browser. That's not possible, AFAIK. By the time the request is forwarded, the browser has already determined the URL of the servlet, and the only I know of way to have the browser change the URL to the forwarded Servlet/JSP is to send a Location: header (i.e. sendRedirect()). Remember that server-side dispatching is transparent to the client. Maybe there's some tricky stuff you can do with JavaScript to change the address in the address bar without reloading the page?
    Brian

  • Problem in passing data from one .jsp page to another .jsp page

    i have a problem here
    Actually i have 2 jsp pages. What im trying to do here is actually i want to pass data from the first jsp page to the second for updating
    The first jsp page contains data that user wants to update in the form of table.
    <td><img src = "edit.gif" alt = "edit" border="0" ><td>
    <TD><%= Name %></td>
    <TD><%= rs.getInt("Age") %></td>
    <TD><%= rs.getString("Gender") %></td>
    So this page displays the data that users wants to update plus one image button (edit button). So when user clicks this button, all the data in this page will be brought to the second .jsp page called updatePersonal for updating.
    The problem here is that it is not displaying the existing data in the second .jsp page.
    The second page basically contains forms
    <INPUT TYPE="text" NAME="FirstName" maxlength="30" value = "<%=FirstName%>">
    Can someone please help me. I really dont know what to do..How do i get the data displayed in the text field that is passed from the first .jsp page..thankx in advance

    Please modify below code to:
    td><img src = "edit.gif" alt = "edit" border="0" ><td>
    -----------------modified code
    td><a href="updatePersonal.jsp?FirstName=<%=rs.getString(FirstName")%">&LastName=<%=rs.getString("LastName")%>&Age=<%=rs.getInt("Age")%>&Gender=<%=rs.getString("Gender")%>"><img src = "edit.gif" alt = "edit" border="0" ></a><td>
    I'm sure it works</a>

  • Passing data from JSP to existing iView in Portal

    Hello Experts,
    I'm new to EP and Web DynPro. Please provide your guidance for the following scenario:
    There are 2 iViews in different pages.
    iView 1(Web DynPro Java application) - its running in portal
    - created by other person long time back - it takes input from user to create a support message
    iView 2(JSP page)
    - since iView 1 is very generic, I have to create one more iView, which is simple & specific to user request, but should pass the data to the iView 1, which in turn will create a support message.
    My Question:
    Is it possible to pass data from my JSP page(in iView2) to the running application in iView1?
    (I don't have access to the code of the running application- so i can't use Client Data Bag or sessions)
    If the above condition is possible, then is it possible to hide the iView 1, so that user doesn't need to see the iView 1 when they submit data?
    Please guide me with sample code or links.
    Thanks in advance,
    Aruna Thamilmani

    You could have the Applet make a request to the server (via URLConnection).

  • Passing data from calling page to popup window

    Hi All,
    We are developing a BSP application for business card.I need to provide a preview button .
    when the user clicks this button a
    poopup window should open with the preview of business card.
    My problem is how to pass the values like name , designation etc from the main page to popup window.
    The code for previre image:
    <h t m l b : i m a g e   s r c = " s _ b _ d e  tl . g i f  " a l t = " P r e v i e w   C a r d "  o n C l i c k="addr" on C l i e n t C l i c k = " c a l l W i n d o w ( ) ; "/>
    <s c r i p  t t y p e = " t e x t / j a v a s c r i p t ">
    f u n c t i o n  c a l l W i n d o w ()
    w i n d o w .o p e n ( " p r e v i e w . h t m " ) ;
    </s c r i p t >
    preview.htm is a simple HTML page . i need to pass values from main page to this page.
    OR
    Is it possibel to restrict the size of a VIEW to use it as a popup window?
    OR
    is there any other way to achieve this like.. the <bsp:call comp_id=" " />
    tag , but i have no idea how to use it.
    Thanks,
    Anubhav.
    Edited by: Anubhav Jain on Sep 12, 2008 3:38 PM

    Hi Raja,
    I did as suggested by you...but it is behaving strangely.
    It works fine in debuging mode but when executed directly ....it is not working.
    the scenario is:
    Thers an image for preview as follows:
    <htmlb:gridLayoutCell columnIndex="3" rowIndex="13">
    <htmlb:i m a g e   s r c = " s _ b _ d e t l . g i f "   a l t = " P r e v i e w   C a r d "   o n C l i c k = " a d d r "   o n C l i e n t C l i c k = " c a l l W i n d o w ( ) ; " /  >
    </htmlb:gridLayoutCell>
    The JS code is:
    f u n c t i o n   c a l l W i n d o w ( )
    <%
    data: title(5),
             fname(20),
             lname(20),
             comp(20),
             addr(20),
             city(20),
             state(20),
             pcode(20),
             country(20),
             phone(20),
             fax(20),
             email(241).
             alt_addr-title = request->get_form_field( 'title' ) .
             alt_addr-firstname = request->get_form_field( 'fname' ) .
             alt_addr-lastname = request->get_form_field( 'lname' ) .
             company = request->get_form_field( 'comp' ) .
             alt_addr-street = request->get_form_field( 'addr' ) .
             alt_addr-city = request->get_form_field( 'city' ) .
             alt_addr-region = request->get_form_field( 'state' ) .
             alt_addr-inhouse_ml = request->get_form_field( 'pcode' ) .
             alt_addr-country = request->get_form_field( 'country' ) .
             alt_addr-tel1_numbr = request->get_form_field( 'phone' ) .
             alt_addr-fax_number = request->get_form_field( 'fax' ) .
             alt_addr-e_mail = request->get_form_field( 'email' ) .
    CALL METHOD cl_bsp_server_side_cookie=>set_server_cookie
              EXPORTING
                name                  = 'FORMFIELDS'
                application_name      = runtime->application_name
                application_namespace = runtime->application_namespace
                username              = sy-uname
                session_id            = runtime->session_id
                data_value            = alt_addr
                data_name             = 'alt_addr'
                expiry_date_rel       = 1.
    %>
    w i n d o w . o p e n ( " . . / z _ b i z c a r d / p r e v i e w . h t m " ,   " W i n E " ,   " w i d t h = 2 4 0 , h e i g h t = 3 0 0 , t o o l b a r = n o , r e s i z a b l e = no ")
    I was doing something similar...created a controller and a view , was calling the controller from window.open method with all other parameters for sizing etc.
    How to pass a structure conatining data,from controller to the view...
    Now in the onCreate event of the page PREVIEW.HTM in using;
    CALL METHOD cl_bsp_server_side_cookie=>get_server_cookie
      EXPORTING
        name                  = 'FORMFIELDS'
        application_name      = runtime->application_name
        application_namespace = runtime->application_namespace
        username              = sy-uname
        session_id            = runtime->session_id
        data_name             = 'alt_addr'
      CHANGING
        data_value            = alt_addr.
    and in the layout of PREVIEW.HTM in am using this alt-addr:
    But if put a break point at the onCreate event of preview.htm and the execute i get the values in alt_addr but if i execute directly...it is empty in the layout?
    What is the problem?
    Thanks,
    Anubhav.

Maybe you are looking for