老师这个需要怎么判断
<%@page import="java.util.List"%>
<%@page import="com.imooc.model.Food"%>
<%@page import="com.imooc.model.FoodDaoImpl"%>
<%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"%>
<%@ 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>
<html>
<head>
<base href="<%=basePath%>">
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<title>菜品信息展示</title>
<style type="text/css">
</style>
</head>
<body>
<%
List<Food> food=(List<Food>)application.getAttribute("food");
List<Food> list=(List<Food>)application.getAttribute("list");
if(food==null){
application.setAttribute("foodList", list);
}else{
application.setAttribute("foodList", food);
}
%>
<center>
<h1>菜品查询</h1>
<font><h3 style="color:red">${msg }</h3></font>
<table border="1px" cellspacing="0px" cellpadding="0px" width="800px">
<thead>
<tr>
<th>菜品ID</th>
<th>菜名</th>
<th>口味</th>
<th>菜品图片</th>
<th>价格</th>
<th>菜品描述</th>
</tr>
</thead>
<tbody>
<c:forEach items="${applicationScope.foodList }" var="food">
<tr>
<td>${food.fid }</td>
<td>${food.fname }</td>
<td>${food.lavor }</td>
<td><img src="/variety_of_dishes/upload/${food.imgaddress }"></td>
<td>${food.peice }</td>
<td>${food.describe }</td>
</tr>
</c:forEach>
</tbody>
</table>
</center>
</body>
</html>0
收起
正在回答 回答被采纳积分+1
1回答
从网页搭建入门Java Web2018版
- 参与学习 人
- 提交作业 1088 份
- 解答问题 10204 个
如果你有Java语言基础,又想以后从事Java Web开发,那么本路径是你的不二选择!本路径从网页搭建开始入手,通过大量案例来学习Java Web基础。定能助你完成Java Web小白的蜕变!
了解课程
恭喜解决一个难题,获得1积分~
来为老师/同学的回答评分吧
0 星