Submitting Text Fields 2 : Form TextField « JSP « Java






Submitting Text Fields 2

//File: index.html
<HTML>
    <HEAD>
        <TITLE>Submitting Text Fields</TITLE>
    </HEAD>
 
    <BODY>
        <H1>Submitting Text Fields</H1>
        <FORM ACTION="formAction.jsp" METHOD="POST">
            Please enter your name:
            <INPUT TYPE="TEXT" NAME="text1">
            <BR>
            <INPUT TYPE="SUBMIT" value="Submit">
        </FORM>
    </BODY>
<HTML>


//File:formAction.jsp
<HTML>
    <HEAD>
        <TITLE>Decoding an HTTP Request</TITLE>
    </HEAD>
 
    <BODY>
        <H1> Request Information </H1>
        JSP request method: <%= request.getMethod() %>
        <BR>
        URL for the request: <%= request.getRequestURI() %>
        <BR>
        Protocol of the request: <%= request.getProtocol() %>
        <BR>
        Server name: <%= request.getServerName() %>
        <BR>
        Path: <%= request.getServletPath() %>
        <BR>
        Server port: <%= request.getServerPort() %>
        <BR>
        Remote address: <%= request.getRemoteAddr() %>
        <BR>
        Remote host: <%= request.getRemoteHost() %>
        <BR>
        Locale: <%= request.getLocale() %>
        <BR>
        User agent: <%= request.getHeader("User-Agent") %>
    </BODY>
</HTML>


           
       








JspFormActionHeader.zip( 89 k)

Related examples in the same category

1.Form TextField Demo
2.Submitting Text Fields
3.Inserting Text into Text Fields