javaweb基础编程

<%@ page language="java" contentType="text/html; charset=UTF-8"
    pageEncoding="UTF-8"%>
    <%@ page import="java.util.Date" %>
    <%@ page import="java.text.SimpleDateFormat" %>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>Insert title here</title>
</head>

<script type="text/javascript"
  var price=998;
  var number=10;
  var sum=price*number;
  alter(sum);
>
</script>
<style>
.one{
font-family:宋体;
font-size:26px;
color:red;
}
.two{
font-famliy:宋体;
font-size:30px;
color:red;
}
.three{
font-famliy:宋体
font-size:12px
color:red
}
</style>
<body>
<h1>Hello World</h1>
<h2>shixinfa</h2>
<center>
<p>史新发</p>
</center>
<ol>
<li>shixinfa</li>
<li>lilaoshi</li>
<li>zhangyan</li>
</ol>
<tr>
<td align="center" valign="middle">姓名</td>
<td align="center" valign="middle">语文</td>
<td align="center" valign="middle">数学</td>
<td align="center" valign="middle">英语</td>
</tr>

<tr>
<td align="center" valign="middle">张三</td>
<td align="center" valign="middle">90</td>
<td align="center" valign="middle">8</td>
<td align="center" valign="middle">89</td>
</tr>
<tr>
<td align="center" valign="middle">李四</td>
<td align="center" valign="middle">70</td>
<td align="center" valign="middle">28</td>
<td align="center" valign="middle">9</td>
</tr>
<tr>
<td height="35" align="cneter" valign="middle"><a href="message.html">查看详情</a>
</tr>
<form action="" method="post" name="myform">
用户名 :<input name="username" type="text" id="username" maxlength="20">
密码:<input name="pwd" type="password" id="pwd" size="20" maxlength="20">
</form>
<ul>
<a href="#">明日图书</a>2011-9-27
<a href="#">明日科技</a>2011-9-99
<a href="#">今日头条</a>2001-0-9
</ul>
<h2 class="one">应用选择器</h2>
<h2 class="two">应用该选择器</h2>

<%
 Date date=new Date();
SimpleDateFormat df=new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
String today=df.format(date);
%>
<%=today %>

<%@page import="com.mysql.jdbc.Util"%>
<%@page import="org.apache.jasper.tagplugins.jstl.core.Import"%>
<%@ page language="java" import="java.util.*" pageEncoding="utf-8"%>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core"%>
<jsp:useBean id="user" class="com.sxf.User" />
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>Insert title here</title>
</head>
<body>
${"我是个屌丝" }
<%
String name[] = { "shixinfa", "zhangyan", "lixiaolong" };
request.setAttribute("names", name);
%>
${ requestScope.names[2] };
<%
ArrayList<Integer> list = new ArrayList<Integer>();
list.add(1);
list.add(22);
list.add(33);
request.setAttribute("list", list);
%>
${requestScope.list[2]};
${2>3 ?  "yes":"no"};
<c:set var="username" value="shixinfa" scope="session" />
<c:set var="adminname" value="shixiaocun" scope="request" />
${requestScope.adminname} 
${sessionScope.username }
<c:set target="${user}" property="username" value="zhangyan" />
<c:set target="${user}" property="password" value="shixinfa" />
${user.username}; 
${user.password};
</body>
</html>

<c:set target="${user}" property="username" value="zhangyan" />
<c:set target="${user}" property="password" value="shixinfa" />
${user.username}; 
${user.password};

Programming is an art. Although traditional art imitates life, programming simulates life. Every abstract concept in programming, and to a great extent in the fi eld of computer science, has its roots in our daily life. For example, humans and possibly all other living forms were multiprocessing long before the term entered into computer science lingo. Th erefore, any concept in programming can in fact be illustrated through examples from our dayto-day life. Such an approach not only enables the student to assimilate and internalize the concept presented in a programming situation but also provides a solid foundation for the very process of programming, namely, the simulation of the real world. Unfortunately, textbooks currently on the market do not exploit this fact through examples or meaningful discussions. Th us, for many students, an abstract concept remains abstract. Th is is especially true in the case of object-oriented programming. Th e “wow moment” one gets by seeing programming as a simulation of the real-world situation is never realized. Th is book on Java programming teaches object-oriented design and programming principles in a completely integrated and incremental fashion. Th is book allows the reader to experience the world we live in as object-oriented. From the very outset the reader will realize that everything in this world is an object. Every concept of object-oriented design is fi rst illustrated through real-life analogy. Corresponding Java language constructs are introduced in an integrated fashion to demonstrate the programming required to simulate the real-world situation. Instead of compartmentalizing all the object-oriented concepts into one chapter, this book takes an incremental approach. Th e pedagogy of this book mirrors the classroom style the author has developed over the years as a teacher of computer science. In particular, every programming concept is introduced through simple examples followed by short programming examples. Case studies at the end of each chapter illustrate various design issues as well as the usefulness of many new concepts encountered in that chapter. Java has emerged as the primary language for soft ware development. From a soft ware engineering perspective, object-oriented design has established itself as the industry standard. Th us, more and more teaching institutions are moving toward a CS1 course that teaches Java programming and object-oriented design principles. A common approach followed in many textbooks on the market is to introduce object-oriented concepts from the very beginning and ignore many traditional programming techniques completely. Th e objective of this book is to present object-oriented programming and design without compromising the training one needs on traditional programming constructs and structures.
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值