JAVA 大作业——DAY 2
进度日记:8.30
上午:汇编课
中午:上课一半跑去问610,大概看了一下他的servlet文件怎么写的,相应的web.xml怎么配的;
他建议我,什么都不要加先写后台的数据处理,并给了我一个入门教程:http://www.bccn.net/article/web/jsp/jc/200409/72.html
下午1点:开始写后台了,之前在eclipse下可以运行的“HelloServlet”放到myeclipse下,能配置好web.xml;
myeclipse里新建web工程之后,就自带index.jsp页面,这是我学习的第一个jsp文件,学会了如何访问这个页面:
1 <%@ page language="java" import="java.util.*" pageEncoding="UTF-8"%> 2 <% 3 String path = request.getContextPath(); 4 String basePath = request.getScheme()+"://"+request.getServerName()+":"+request.getServerPort()+path+"/"; 5 %> 6 7 <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"> 8 <html> 9 <head> 10 <base href="<%=basePath%>"> 11 12 <title>My JSP 'pp.jsp' starting page</title> 13 14 <meta http-equiv="pragma" content="no-cache"> 15 <meta http-equiv="cache-control" content="no-cache"> 16 <meta http-equiv="expires" content="0"> 17 <meta http-equiv="keywords" content="keyword1,keyword2,keyword3"> 18 <meta http-equiv="description" content="This is my page"> 19 <!-- 20 <link rel="stylesheet" type="text/css" href="styles.css"> 21 --> 22 23 </head> 24 25 <body> 26 This is my JSP page. <br> 27 </body> 28 </html>
晚饭没吃,突然发现可以把别人的网页源码直接拷过来学习;
把源代码拷过来,直接写成jsp文件,保存各种css文件(网页源码上也都能找到),改成了可以看的样子,完成了3个静态页面(index、login、register)。
晚上9点:饿死了,回来睡觉。
浙公网安备 33010602011771号