jsp tomcat
来源:互联网 发布:sql server介绍 编辑:程序博客网 时间:2024/06/08 03:28
jsp
c/s与b/s
什么是C/S结构?
C/S (Client/Server)结构,即客户机和服务器结构。
客户端 –>服务器 — QQ — C(Client)/S(Server)
什么是B/S结构?
B/S(Browser/Server)结构即浏览器和服务器结构。
B/S架构采用请求、响应进行交互**
安装tomcat与在myels里使用。若端口号被占用则需改变端口号。
jsp代码
<%@ page language="java" import="java.util.*" pageEncoding="ISO-8859-1"%><%String path = request.getContextPath();String basePath = request.getScheme()+"://"+request.getServerName()+":"+request.getServerPort()+path+"/";%><!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"><html> <head> <base href="<%=basePath%>"> <title>My JSP 'index.jsp' starting page</title> <meta http-equiv="pragma" content="no-cache"> <meta http-equiv="cache-control" content="no-cache"> <meta http-equiv="expires" content="0"> <meta http-equiv="keywords" content="keyword1,keyword2,keyword3"> <meta http-equiv="description" content="This is my page"> <!-- <link rel="stylesheet" type="text/css" href="styles.css"> --> </head> <body> This is my JSP page. <br> </body></html>
404错误 找不到访问的页面或资源
1.运行时,url输入错误
2.将页面将在WEB-INF
3.外部启动Tomcat,未部署项目
阅读全文