tomcat服务器与客户端是两个不同的程序,端口号也不一样,服务器响应请求之后发送数据到客户端只能通过response对象去处理。response对象是servlet中方法的参数。
out.write("deployer-howto.html\">Deployer</a></li>\n");
out.write(" </ul>\n");
out.write(" </div>\n");
out.write(" </div>\n");
out.write(" <div class=\"col20\">\n");
out.write(" <div class=\"container\">\n");
out.write(" <h4>Get Involved</h4>\n");
out.write(" <ul>\n");
out.write(" <li><a href=\"");
out.write((String) org.apache.jasper.runtime.PageContextImpl.proprietaryEvaluate("${tomcatUrl}", String.class, (PageContext)_jspx_page_context, null));
out.write("getinvolved.html\">Overview</a></li>\n");
out.write(" <li><a href=\"");
out.write((String) org.apache.jasper.runtime.PageContextImpl.proprietaryEvaluate("${tomcatUrl}", String.class, (PageContext)_jspx_page_context, null));
out.write("source.html\">Source Repositories</a></li>\n");
out.write(" <li><a href=\"");
out.write((String) org.apache.jasper.runtime.PageContextImpl.proprietaryEvaluate("${tomcatUrl}", String.class, (PageContext)_jspx_page_context, null));
out.write("lists.html\">Mailing Lists</a></li>\n");
out.write(" <li><a href=\"https://wiki.apache.org/tomcat/FrontPage\">Wiki</a></li>\n");
out.write(" </ul>\n");
out.write(" </div>\n");
out.write(" </div>\n");
out.write(" <div class=\"col20\">\n");
out.write(" <div class=\"container\">\n");
out.write(" <h4>Miscellaneous</h4>\n");
out.write(" <ul>\n");
out.write(" <li><a href=\"");
out.write((String) org.apache.jasper.runtime.PageContextImpl.proprietaryEvaluate("${tomcatUrl}", String.class, (PageContext)_jspx_page_context, null));
out.write("contact.html\">Contact</a></li>\n");
out.write(" <li><a href=\"");
out.write((String) org.apache.jasper.runtime.PageContextImpl.proprietaryEvaluate("${tomcatUrl}", String.class, (PageContext)_jspx_page_context, null));
可以看到部分代码段中有很多地方使用write方法向客户端传输html标签。
证毕
<%@ page contentType="text/html;charset=UTF-8" language="java" errorPage="error.jsp" %>
<%@ include file = "a.jsp" %>
//最小的域对象,仅限于当前页面
pageContext.setAttribute("name","李白");
//request域对象,使用范围限于转发之间的页面
request.setAttribute("name","韩信");
//session域对象,范围是一次会话,浏览器或服务器不关闭称为一次会话,该工程下的任何jsp页面都可以取到
session.setAttribute("name","孙尚香");
//application域对象,范围最大,只要服务器不关,那么存的值一直有效
application.setAttribute("name","马可波罗");
MVC全名是Model View Controller,是模型(model)-视图(view)-控制器(controller)的缩写,一种软件设计典范,用一种业务逻辑、数据、界面显示分离的方法组织代码,将业务逻辑聚集到一个部件里面,在改进和个性化定制界面及用户交互的同时,不需要重新编写业务逻辑。
本文地址:https://blog.csdn.net/MrYushiwen/article/details/107582536
如对本文有疑问, 点击进行留言回复!!
SpringBoot 整合 RocketMQ 实现消息生产消费(RocketMQTemplate实现)
【学习日记】(SpringBoot-part 4)新闻管理系统—添加和修改新闻功能
网友评论