zoukankan      html  css  js  c++  java
  • jsp其实是一个java类

    我们打开tomcat的D:Program_Filesapache-tomcat-8.0.32workCatalinalocalhostvenusorgapachejsp,

    当我们访问过页面后会发现login.jsp会生成两个文件login_jsp.class和login_jsp.java

    我们打开java文件其中有这段代码

    out.write(" ");
    out.write("<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd"> ");
    out.write("<html> ");
    out.write(" <head> ");
    out.write(" <meta http-equiv="Content-Type" content="text/html; charset=UTF-8"> ");
    out.write(" <title>百度一下</title> ");
    out.write(" </head> ");
    out.write(" <body> ");
    out.write(" <form action="./DoLoginServlet" method="post"> ");
    out.write(" <input name="user_name"> ");
    out.write(" <input type="password" name="password"> ");
    out.write(" <button type="submit">提交</button> ");
    out.write(" </form> ");
    out.write(" ");
    out.write(" </body> ");
    out.write("</html>");

    发现原理JSP里的内容变成了字符串

    JSP文件是在一个类中的

  • 相关阅读:
    服务器负载均衡的基本功能和实现原理
    二分查找
    TCP的运输连接管理
    linux常用命令
    XX公司在线笔试题编程题之一
    java对象转json格式
    Java多线程并发技术
    进程同步与通信
    单例模式的C++实现
    rsyncd启动脚本
  • 原文地址:https://www.cnblogs.com/lyxcode/p/9458478.html
Copyright © 2011-2022 走看看