JSP without beans : Basics « JSP « Java






JSP without beans

//createPerson.jsp
<html>
  <head><title>Create Person</title></head>
  <body>
    <h1>Enter your details</h1>
    <form action="displayDetails.jsp" method="post">
      <table>
        <tr><td>First name:</td>
            <td><input type="text" name="firstName" /></td>
        </tr>
        <tr><td>Last name:</td>
            <td><input type="text" name="lastName" /></td>
        </tr>
        <tr><td>Age:</td>
            <td><input type="text" name="age" /></td>
        </tr>
      </table>
      <input type="submit" value="Submit details" />
    </form>
  </body>
</html>

// displayDetails.jsp

<%@ taglib prefix="c" uri="http://java.sun.com/jstl/core" %>

<html>
  <head><title>Display details</title></head>
  <body>
    <h1>Your details (or, the details you entered!)</h1>
    <table>
      <tr><td>First name</td><td><c:out value="${param.firstName}" /></td></tr>
      <tr><td>Last name</td> <td><c:out value="${param.lastName}"  /></td></tr>
      <tr><td>Age</td>       <td><c:out value="${param.age}"       /></td></tr>
    </table>
  </body>
</html>




           
       








Related examples in the same category

1.JSP Passing Parameters
2.Simplest Jsp page: A Web Page
3.Output: Creating a Greeting
4.Simple JSP outputSimple JSP output
5.Simple JSP page to display the random number
6.Comments in JSP page
7.Declaration Tag Example
8.Declaration Tag - Methods
9.Expression Language Examples
10.Passing parameters
11.JSP Initialization
12.Welcome page and top level URL
13.JSP Expression Language
14.Request header display in a JSP
15.Multiple Declaration
16.Embedding Code
17.pwd -- print working directory
18.JSP post
19.JSP Post Data Viewer
20.JSP in J2EE
21.JSP Performance
22.JSP Best Practices and Tools
23.JSP Model 2JSP Model 2
24.JSP: expression language 2JSP: expression language 2
25.JSP Basics: Dynamic Page Creation for Data Presentation 2JSP Basics: Dynamic Page Creation for Data Presentation 2
26.JSP Directives: your page
27.JSP Directives
28.JSP Basics ch02 JSP Basics ch02
29.JSP Basics: Generalized Templating and Server Scripting 1JSP Basics: Generalized Templating and Server Scripting 1
30.JSP Basics: Generalized Templating and Server Scripting 2JSP Basics: Generalized Templating and Server Scripting 2
31.JSP Basics: Generalized Templating and Server Scripting 3JSP Basics: Generalized Templating and Server Scripting 3
32.CSS, JavaScript, VBScript, and JSP 1CSS, JavaScript, VBScript, and JSP 1
33.CSS, JavaScript, VBScript, and JSP 2CSS, JavaScript, VBScript, and JSP 2
34.Advanced Dynamic Web Content Generation. 1Advanced Dynamic Web Content Generation. 1