细节之痒 持续更新中...
来源:互联网 发布:淘宝贷款利息多少 编辑:程序博客网 时间:2024/05/14 20:29
1.为什么mvc中model 整数类型要用integer复合数据类型而非int基本数据类型?
因为数据库里的,比如说年龄,是会出现null值的,而int基本数据类型没有null 默认为0
2.EL JSTL的区别(来自百度知道)
EL即Expression Language(表达式语言)EL的语法:${ EL exprission }${ bean.name } 或 ${ bean['name'] }说白了,EL是用来显示数据的,功能跟<%=表达式%> 一样,EL是不需要引入什么东西的JSTL(JavaServerPages Standard Tag Library)JSP标准标签库JSTL标准标签库包括核心标签库和SQL标签库,核心标签库常用的是if和forEach说白了JSTL常实现网页逻辑判断和迭代显示的,需要引入<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c"%>只要JSTL和EL结合,就基本可以让页面再无<% %> jsp代码了。给你一段我今天考试的代码:<%@ page language="java" import="java.util.*" pageEncoding="GBK"%><%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c"%><%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> <form action="work.do?method=search" method="post"> <table border="1" align="center" width="50%"> 班级:<select name="student.s_class"> <option value="0">全部</option> <c:forEach var="T_class" items="${requestScope.tClassList}"> <option value="${T_class.c_no}"> ${T_class.c_name} </option> </c:forEach> </select> 科目:<select name="student.s_schedule"> <option value="0">全部</option> <c:forEach var="T_schedule" items="${requestScope.tSchedultList}"> <option value="${T_schedule.s_no}"> ${T_schedule.s_name} </option> </c:forEach> </select> 状态<select name="student.s_status"> <option value="0">全部</option> <option value="1">已处理</option> <option value="2">未处理</option> </select> <input type="submit" value="提交"> </table> </form> <c:if test="${requestScope.searchResult==0}"> <h5 align=center>无此数据</h5> </c:if> <c:if test="${requestScope.searchResult==1}"> <h3 align=center>查询结果如下</h3> <table border="1" align="center" width="50%"> <tr> <th>姓名</th> <th>班级</th> <th>科目</th> <th>成绩/处理</th> </tr> <c:forEach var="MainBean" items="${requestScope.mainList}"> <tr> <td>${MainBean.s_name}</td> <td>${MainBean.c_name}</td> <td>${MainBean.ts_name}</td> <td> <c:if test="${MainBean.s_status==1}">${MainBean.s_score}</c:if> <c:if test="${MainBean.s_status==2}"><a href="work.do?method=toPiyue&stuId=${MainBean.id}">批阅</a></c:if> </td> </tr> </c:forEach> </table></c:if> </body></html>
0 0
- 细节之痒 持续更新中...
- JAVA 基础细节汇总(持续更新中....)
- 用户界面设计细节_持续更新中
- JavaScript细节 持续更新
- 开发细节,持续更新...
- Springboot基础篇 之细节处理(在持续更新中。。。。)
- C#设计模式中细节总结-持续更新中
- jQuery 中一些细节知识点(本文会持续更新)
- jQuery 中一些细节知识点2(本文会持续更新)
- jQuery 中一些细节知识点2(本文会持续更新)
- 开发管理细节,持续更新...
- javascript部分细节(持续更新)
- css部分细节(持续更新)
- linux命令细节(持续更新)
- 开发小细节汇总(持续更新)
- Java 相关细节问题(持续更新)
- Opera_Tips_ 持续更新中
- command持续更新中。。。。
- NYOJ 2 括号配对问题
- 花肥肥料如何收集
- VC++ 6.0点打开按钮出现 “Microsoft (R) Developer Studio 已停止工作”的解决方法
- 育苗基质要注意选择丰富资源
- Java数据库之插入记录
- 细节之痒 持续更新中...
- hdu 2305 WorstWeather Ever 二分 + 线段树(区间最值)
- 螺旋方阵
- 为什么只给出前序以及后序遍历,不能生成唯一的二叉树
- IOS开发 HTTP相关GET/POST请求
- poj 3468 A Simple Problem with Integers (线段树---成段更新)
- 1408070842-hd-不容易系列之(3)—— LELE的RPG难题.cpp
- Linux基础之tomcat重启关闭
- Android Wear 用于发送与同步数据的数据类型与接口概述