0

Everything is ok but mt & cat give me null...

<head>

    <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">

    <title>Video Club</title>

</head>

<body>

    <h1>Movie & Customer Info</h1>

     <%
    String name = request.getParameter("name");
    out.println("Όνομα: " + name); 
    %><br><br>
    <%
    String sur = request.getParameter("surname");
    out.println("Επίθετο: " + sur);
    %><br><br>
    <%
    String card = request.getParameter("card");
    out.println("Πιστωτική κάρτα: " + card);
    %><br><br>
    <%
    String mt = request.getParameter("MovieTitle");
    out.println("Τίτλος Ταινίας: " + mt);
    %><br><br>
    <%
    String cat = request.getParameter("category");
    out.println("Category: " + cat);
    %>

</body>

I'm using netbeans IDE 8.0.2 and this is finalResults.jsp linked with checkout.jsp

<head>

    <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">

    <title>Video Club</title>

</head>
<body>
    <h1>Checkout</h1>
    <h3>Please Use Latin Characters</h3>
     <%
    String mt = request.getParameter("MovieTitle");
    out.println("Τίτλος Ταινίας: " + mt); 
    %>

    <form action ="finalResults.jsp" method="post">
        <br>
    Όνομα:<br>
        <input type="text" name="name">
        <br>
    Επίθετο:<br>
        <input type="text" name="surname">
        <br>
    Πιστωτική κάρτα:<br>
        <input type="text" name="card">
    <br><br>
        <input type ="submit" value ="Ολοκλήρωση"/>
    </form>


</body>

checkout.jsp has also a previous one named list.jsp and before that is index.jsp

2 Answers2

0

mate, you are missing the input in your form

<form action ="finalResults.jsp" method="post">
    <br>
Όνομα:<br>
    <input type="text" name="name">
    <br>
Επίθετο:<br>
    <input type="text" name="surname">
    <br>
Πιστωτική κάρτα:<br>
    <input type="text" name="card">
<br><br>
 <input type="text" name="MovieTitle">
 <input type="text" name="catagory">
    <input type ="submit" value ="Ολοκλήρωση"/>
</form>
Kevin Simple
  • 1,225
  • 10
  • 22
  • i have it in the previous list.jsp in which the user gives an answer but i want this to be printed in the finalResults.jsp

    Επιλέξτε μία από τις διαθέσιμες ταινίες που εμφανίζονται:


    – John Peros Nov 22 '15 at 00:34
  • @then you need passing them from list.jsp to checkour.jsp, you can set thme as hidden fields with the value you previous get, no matter how, you need submit these value with others like name, surname, otherwise it's not gonna work – Kevin Simple Nov 22 '15 at 00:44
0

I used session.setAttribute("SES_CAT",cat); in the second .jsp to store the value and String cat=(String)session.getAttribute("SES_CAT"); in the last .jsp to call it.Thanks for the idea for the hidden fields but that worked better for me...