Linking one JSP to another

How do you create a link going from one JSP to another?
I would like to know how to go by clicking on a link on the first page which when clicked will take you to the second.
I would also like to know how to go to the next page if a certain condition is met.
Thank you in advance.

Sorry I was not that clear before.
I would like to know how to open another JSP page if a
button I have setup is pressed in my first JSP page.
Thank you.
<SCRIPT>
f()
   document.myForm.submit() ;
</SCRIPT>
<FORM ACTION="secondPage.jsp" METHOD="POST" NAME="myForm">
<INPUT TYPE="button" VALUE="Close Window"   onClick="f()">
</FORM>

Similar Messages

  • Passing value from one jsp to another?

    how to pass value from one jsp to another? i have a value assigned in the link, i want to pass that value to another jsp page?
    please help with code?

    Instead of the value being passed, i am getting a null value.
    Here is my calendar code:
    <%@page import="java.util.*,java.text.*" %>
    <html>
    <head>
    <title>Print a month page.</title>
    </head>
    <body bgcolor="white">
    <%
                  boolean yyok = false;
                  int yy = 0, mm = 0;
                  String yyString = request.getParameter("year");
                  if (yyString != null && yyString.length() > 0)
                      try
                          yy = Integer.parseInt(yyString);
                                  yyok = true;
                       catch (NumberFormatException e)
                          out.println("Year " + yyString + " invalid" );
                  Calendar c = Calendar.getInstance( );
                  if (!yyok)yy = c.get(Calendar.YEAR);  
                         mm = c.get(Calendar.MONTH);
    %>
                  <table align="center">
                      <tr>
                  <td>
                       <form method=post action="calendar.jsp">
                          Enter Year : <select name="year">
    <%         
                 for(int i= yy;i<=2010;i++)
    %>
                  <OPTION VALUE= <%=i%> > <%=i%> </option>
    <%       
    %>
              </select>
                      <input type=submit value="Display">
                      </form>
                      </td>
                    </tr>
    <tr>
                     <table>
    <%!
    String[] months = {"January","February","March",
                    "April","May","June",
                    "July","August","September",
                    "October","November", "December"
    int dom[] =     {
                        31, 28, 31, 30,
                        31, 30, 31, 31,
                        30, 31, 30, 31
    %>
    <%
                int leadGap =0;
    %>
    <div id="t1" class="tip"><table border="4" cellpadding=3 cellspacing="3" width="250" align="center" bgcolor="lavender">
    <tr>
    <td halign="centre" colgroup span="7" style="color:#FF0000;">
    </colgroup>
    <tr>
    <td>
    <%
              GregorianCalendar calendar =null;
              for(int j=0;j<12;j++)
                        calendar = new GregorianCalendar(yy, j, 1);
                  int row = 1 ;
                  row = row + j;
        %>
              <table>
                <tr>
              <colgroup span="7" style="color:#FF0000;">
              </colgroup>
                </tr>
              <tr align="center">
              <th colspan=7>
                  <%= months[j] %>
                  <%= yy %>
              </th>
              </tr>
    <tr>
    <td>Sun</td><td>Mon</td><td>Tue</td><td>Wed</td><td>Thu</td><td>Fri</td><td>Sat</td>
    </tr>
    <%
        leadGap = calendar.get(Calendar.DAY_OF_WEEK)-1;
        int daysInMonth = dom[j];
        if ( calendar.isLeapYear( calendar.get(Calendar.YEAR) ) && j == 1)
        ++daysInMonth;
        out.print("<tr>");
        out.print(" ");
          for (int h = 0; h < leadGap; h++)
           out.print("<td>");
          out.print("</td>");
        for (int h = 1; h <= daysInMonth; h++)
          out.print("<td>");
          out.print("<a href=desc.jsp>" + h + "</a>" );
          out.print("</td>");
        if ((leadGap + h) % 7 == 0)
            out.println("</tr>");
    out.println("</tr></table></div>");
    if( row%3 != 0)
    out.println("</td><td>");
    else
    out.println("</td></tr>\n<tr><td>");
    %>
    </html>I need to pass the value in 'h' to the desc.jsp page.
    my code for desc.jsp is :
    <html>
    <head>
    </head>
    <body bgcolor="lightblue">
    <form method=post action="Calenda.jsp">
    <br>
    <%= request.getParameter("h") %>
    <h2> Description of the event <INPUT NAME="description" TYPE=TEXT SIZE=20> </h2>
    <BR> <INPUT TYPE=SUBMIT VALUE="submit">
    </form>
    </body>
    </html>But i am not able to pass the value. The 'h' value contains all the date. i want to pass only a single date, the user clicks to the other page. please help

  • Passing variables from one jsp to another

    Hi All,
    I've searched thru the forum and can't find an answer to a prob I'm having, trying to pass a variable from one jsp to another.
    in file searchBar.jsp i have
    <%
    String archiveSearch = "off";
    %>
    and
    <%
    if (userUtils != null && userUtils.getSearch().equals("on"))
    %>
    <a href="/webLayout/webSideBar.jsp?searchState=<%=archiveSearch%>onclick="archiveSearch = "on""></a>
    and in file webSideBar.jsp
    <%
    String searchState = "off";
    String archiveSearch = (String)request.getParameter("searchState");
    %>
    basically it will give me a variable archiveSearch set to on in webSideBar when the user clicks on the search button, but as it is it's not passing the variable from the searchBar.jsp to the webSideBar.jsp and I think it looks ok !!!! but it's not
    Help

    Looks good to me as well.
    Couple of suggestions
    1 - view source on searchbar.jsp - see what the generated source code for that link is
    2 - Look at the url used to generate webSideBar.jsp. If its not in the address bar, right click the webSideBar page and choose properties.
    Check to see what parameter was passed.
    Are these pages in a frameset? Do you have to specify a target frame for your link?

  • If I get a user to enter their name as a variable and I am linking one movie to another using a button, is there a way to carry the user name forward into the second movie?

    If I get a user to enter their name as a variable and I am linking one movie to another using a button, is there a way to carry the user name forward into the second movie?

    Hi there
    See if the link below helps
    Click here
    Cheers... Rick
    Helpful and Handy Links
    Captivate Wish Form/Bug Reporting Form
    Adobe Certified Captivate Training
    SorcerStone Blog
    Captivate eBooks

  • I would like to simply link one pdf to another

    I would like to link one pdf to another. I create the hyperlink, however when it is selected, I get an error, and it wants to open a webpage.
    Any help? I figured this would be a no brainer.

    You probably already have your answer by now....
    When creating your link, make sure the link action is Open a File.

  • Linking one scene to another...

    Hi,
    Iv been making video's for awhile but what still confuses me
    is whats the best way to link one scene to another? on adobe
    premiere elements its got alot of different ways to link media
    files but most i don't tend to use because i don't want the
    transactions to distract me when making, i tend to either use a
    cross dissolve of dip in black effect or fade in/fade out video
    effect. Without some sort of linking transaction the overall video
    looks undone and messy, however to many effects makes the video
    look more about the effects than the video itself and id rather
    keep the transactions basic, having a dissolve link to long makes
    the clips to short and when making a dissolve to short it looks out
    of place and like a blinking effect! Does anyone get me? if so
    please post!
    x

    I'm not 100% sure you are asking about flash - your entire
    post sounds like a Premiere question. But
    you do mention "scenes" and how to "link" them together -
    what's confusing for me is that there is
    no need to "link" scenes together in Flash - when compiled,
    all scenes become one long timeline.
    Scenes in Flash are a managment convenience in the Flash IDE
    only.
    Do you have a Flash document where you have buttons in 1
    scene and trying to script them to send the
    playhead to frames or labels in another scene?
    Flash doesn't make "videos" in the true sense of the word -
    it is not a video editor like premiere.
    Sorry if I misunderstood - what exactly are you asking?
    ~~~~~~~~~~~~~~~~
    --> Adobe Certified Expert
    --> www.mudbubble.com
    --> www.keyframer.com
    ~~~~~~~~~~~~~~~~
    dandelionx wrote:
    > Hi,
    > Iv been making video's for awhile but what still
    confuses me is whats the best
    > way to link one scene to another? on adobe premiere
    elements its got alot of
    > different ways to link media files but most i don't tend
    to use because i don't
    > want the transactions to distract me when making, i tend
    to either use a cross
    > dissolve of dip in black effect or fade in/fade out
    video effect. Without some
    > sort of linking transaction the overall video looks
    undone and messy, however
    > to many effects makes the video look more about the
    effects than the video
    > itself and id rather keep the transactions basic, having
    a dissolve link to
    > long makes the clips to short and when making a dissolve
    to short it looks out
    > of place and like a blinking effect! Does anyone get me?
    if so please post!
    > x
    >

  • HOW TO MOVE FROM ONE JSP TO ANOTHER BY HIDING URL CHANGES

    HOW TO MOVE FROM ONE JSP TO ANOTHER BY HIDING URL CHANGES IN AN ADDRESS BAR

    Please check before posting that you have not accidentally turned on the CAPS LOCK feature of your keyboard.
    To answer your question. You can't do that. There are alterate ways to solve this sort of problem. What exactly is the nature of the problem you are seeking to solve?

  • How to link one menu to another.

    Hey guys,
    I am creating a user input form for car types and car parts. I want to link one menu to another. I.e. the first menu will be make with a list of car makes, and if the user chooses "Ford" then the next menu will load items from a table "Ford" with the Ford models in it. I have the tables created in a database, one tabel is make with 50 different makes, and then i have 50 other tables for each make with the model types in it.
    Sorry if this is confusing please ask me if you need any more info.
    Thanks in advance

    supersham101 wrote:
     I want to link one menu to another. I.e. the first menu will be make with a list of car makes, and if the user chooses "Ford" then the next menu will load items from a table "Ford" with the Ford models in it.
    What you are looking for is a dependent drop-down menu. To get the values for the second menu, you need to send another request to the server, either by submitting the form again, or by using an Ajax request to populate the dependent drop-down. I don't know of any online tutorials for doing this, but you should be able to find something by doing a Google search. I know that "jQuery in Action, Second Edition" by Bear Bibeault and Yehuda Katz (published by Manning) describes in considerable detail how to do this.

  • How to pass information from one JSP to another JSP? help please

    hi there
    my question is how to pass some information such from one JSP to another one. for exmple, on one page there is a form, and i need to pass some values from the form to another jsp, or some values that were calculated on one JSP and need to be passed to another one. thanks

    You can do this in several ways...here is a simple one...
    When you call the second page url, use this
    http://www.mysite.com?myVariableFromPageOne="hello"
    on the second page use this:
    String firstPageVariable = request.getParameter("myVariableFromPageOne");
    Thanks

  • How to carry an object from one JSP to another JSP?

    How can I carry an object from one JSP to another JSP?
    I have a servlet where I am setting an object in request as an attribute and then forwarding to PageA.jsp.
    MyDTO myDTO = new MyDTO();
    request.setAttribute("MyDTO", myDTO);
    RequestDispatcher rd = getServletContext().getRequestDispatcher("/PageA.jsp");
    rd.forward(request, response);
    I can get MyDTO object in PageA.jsp:
    MyDTO myDTO = (MyDTO) request.getAttribute("MyDTO");
    Now PageA.jsp has a form named form_pageA which submits to PageB.jsp. How can I make sure that myDTO object is available in PageB.jsp? I would like to not store it in session.
    Edited by: srhcan on May 4, 2012 7:52 PM

    srhcan wrote:
    but its not a text I want to store; instead its a JavaBean object. Thats why I cannot use a hidden text type input field.No, but perhaps you could stick something in there which you can use to reconstruct your DTO object on the next request?

  • How can i get the values from one JSP to another JSP

    Hi All,
    I am very new to JSP technology, I have one jsp having radio button, i want to accecc the state of this radio button to another JSP page, How can i do this.
    Could anybody help me.
    with Regards
    Suresh

    Try page import <%@ page import ="index.jsp" %> or include <%@include file="index.jsp" %> methods perhaps they might work.

  • Error message appears when linking one project to another.

    I keep having problems linking a captivate project to another project.  The projects are saved as .cp files stored in the same folder as all of my other Captivate files.  I did publish them to .htm files and it worked. 
    Why would they not link properly when they are in .cp format?  It also gives me a message that states the directory the file is in does not exist.  However, I have checked the pathfile name twice and it is correct. 
    Any ideas what may be happening?

    The last Captivate version to use .cp format was Captivate 4.  So you must be speaking about version 4 or earlier here?
    The .cp format is the source project file, not an output format like HTML/SWF or PDF.  You may be accustomed to other software apps like MS Office where the output is the same as the source (DOC, PPT, XLS, etc) but Captivate is a different beast.
    There's no point trying to link one Captivate project file to another.  What you are probably hoping to do is link the OUTPUT from one Captivate project to the OUTPUT from another project.  Is that correct?

  • Linking one file to another

    Is there a way to link 1 file to another file using Numbers '08? I can easily link worksheet to worksheet, but what if I want to link information from "file 1A" to a cell in a completely different one- like "file 1b" - that is not associated with the other file?
    Help?

    Question asked and resoonded many tilmes.
    (1) Numbers '08' will no longer evplve.
    (2) the wanted feature is unavailable in Numbers '09.
    We may build a workaround with an Applescript but it will require a human action to update data wich is far from being safe.
    For a user with very specific needs, I wrote an Applrscript wich ask the values in Display dialogs" and store them in several files.
    It's the more efficient workaround which I was able to write.
    Yvan KOENIG (VALLAURIS, France) lundi 26 octobre 2009 21:10:56

  • Passing variable from one JSP to another

    Hi....
    I am working on customizing Oracle Application(istore).
    I need to pass variable from 1 JSP to another.
    JSP 1 contains the following line of code:
    <INPUT type="HIDDEN" name="soldtoCustPartyName" value="<%=soldtoCustPartyName%>">
    How can I pass this to another JSP Page. The other JSP should take the 'soldtoCustPartyName' and find out the primary address country.
    So please help me in getting variable passed from 1st JSP to next.
    By default, 1st JSP is not fwded to 2nd JSP.
    This is very very urgent...Please help.....

    When you push the submit button on jsp1 - it goes to jsp2?
    ie
    // in jsp1.jsp
    <form action="jsp2.jsp">
    <INPUT type="HIDDEN" name="soldtoCustPartyName" value="<%=soldtoCustPartyName%>">
    <input type="submit">
    </form>
    //Then in jsp2.jsp all you need is
    request.getParameter("soldtoCustPartyName");This will pick up the value that is coming from the hidden field on jsp1

  • 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

Maybe you are looking for