加入收藏 | 设为首页 | 会员中心 | 我要投稿 北几岛 (https://www.beijidao.com.cn/)- 科技、建站、经验、云计算、5G、大数据,站长网!
当前位置: 首页 > 大数据 > 正文

[javaEE] jsp的指令

发布时间:2021-05-21 06:43:39 所属栏目:大数据 来源: https://www.jb51.cc
导读:jsp 的指令: jsp 的指令( directive )是为 jsp 引擎而设计的,他们并不直接产生任何可见输出,而是告诉引擎如何处理 jsp 页面中的其他部分 ? 页面头部的 page 指令 %@page import="org.apache.jasper.tagplugins.jstl.core.Out"% %@page import="java.uti

jsp的指令:jsp的指令(directive)是为jsp引擎而设计的,他们并不直接产生任何可见输出,而是告诉引擎如何处理jsp

页面中的其他部分

?

页面头部的page指令

<%@page import="org.apache.jasper.tagplugins.jstl.core.Out"%>

<%@page import="java.util.Date"%>

<%@ page language="java" contentType="text/html; charset=utf-8"

pageEncoding="utf-8"%>

?

配置错误页面:

<%@ page errorPage="500.jsp"%>

web.xml

??<error-page>

?? <error-code>500</error-code>

?? <location>/500.jsp</location>

??</error-page>

??<error-page>

?? <error-code>404</error-code>

?? <location>/404.jsp</location>

??</error-page>

?

解决中文乱码:

<%@ page language="java" contentType="text/html; charset=utf-8"

pageEncoding="utf-8"%>

?

页面包含:

<%@include file="footer.jsp" %>

?

jsp的九大隐式对象:

jsp页面翻译成Servlet后,在service方法中,自动为我们定义出来的九个对象

page对象,当前Servlet对象

config

application

response

request

session

out

pageContext

final javax.servlet.jsp.PageContext pageContext;

????javax.servlet.http.HttpSession session = null;

????final javax.servlet.ServletContext application;

????final javax.servlet.ServletConfig config;

????javax.servlet.jsp.JspWriter out = null;

????final java.lang.Object page = this;

????javax.servlet.jsp.JspWriter _jspx_out = null;

????javax.servlet.jsp.PageContext _jspx_page_context = null;

(编辑:北几岛)

【声明】本站内容均来自网络,其相关言论仅代表作者个人观点,不代表本站立场。若无意侵犯到您的权利,请及时与联系站长删除相关内容!

    推荐文章
      热点阅读