Comparison of HTML and JSP pages

Source: Internet
Author: User

A comparison of HTML pages and JSP pages

Ii. interaction of HTML pages and JSP pages

Instance one,

  • Problem Description:
    • The action= "*.jsp" in the form in the HTML page, after clicking the Submit Type button on the HTML page, jumps to the JSP page
    • Use the value of a label in an HTML page in *.jsp
  • Programming Implementation:
    • Input.html
      • <!DOCTYPE HTML PUBLIC "-//w3c//dtd HTML 4.01 transitional//en" "Http://www.w3.org/TR/html4/loose.dtd "><HTML><Head><Metahttp-equiv= "Content-type"content= "text/html; charset=utf-8"><title>HTML pages transfer data to JSP pages</title></Head><Body>    <formAction=display.jspMethod= "Get">Name:<inputtype= "text"name= "UserName"/>        <inputtype= "Submit"value= "Pass to JSP page">    </form></Body></HTML>
    • display.jsp
      • <%@ Page Language="Java"ContentType="text/html; Charset=utf-8"pageencoding="UTF-8"%><!DOCTYPE HTML PUBLIC "-//w3c//dtd HTML 4.01 transitional//en" "Http://www.w3.org/TR/html4/loose.dtd "><HTML><Head><Metahttp-equiv= "Content-type"content= "text/html; charset=utf-8"><title>Receive the form data passed by the HTML page and show</title></Head><Body>    <H1>Receives the form data passed by the HTML page and displays the value of the HTML page form label</H1>    <%        Stringname=Request.getparameter ("UserName"); Out.println (""+name+""); %></Body></HTML>
  • Results show:

    •   

        

Comparison of HTML and JSP pages

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.