01/10/2018, 08:24
Lỗi trong web java (DAO;BO;controller;BEAN)
mình mới học mà ko hiểu lắm về ĐẠO;BỘ;controller;BEAN, giúp với
…lỗi
code java.file trangchu.jsp
<%@page import="Model.Bean.LoaiBean"%>
<%@page import="Model.Bean.SachBean"%>
<%@page import="java.util.ArrayList"%>
<%@ page language="java" contentType="text/html; charset=utf-8"
pageEncoding="utf-8"%>
<!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>
<table width='1000' align='center'>
<tr>
<td colspan="3" align="right">
<%@include file='TieuDe.jsp' %>
</td>
</tr>
<tr>
<td colspan="3">
<%@include file='Menu.jsp' %>
</td>
</tr>
11
<tr>
<td valign="top" width='200'>
<table>
<%
ArrayList<LoaiBean> dsloai=(ArrayList<LoaiBean>)
request.getAttribute("lstLoai");%>
<%for(LoaiBean l: dsloai){ %>
<tr>
<td>
<a href='SachServelet?ml=<%=l.getMaloai()%>'>
<%=l.getTenloai()%>
</a>
</td>
</tr>
<%} %>
</table>
</td>
<td>
<%ArrayList<SachBean> ds;
if(request.getAttribute("lstSach")!=null){
ds=(ArrayList<SachBean>)request.getAttribute("lstSach");
}else
if(request.getAttribute("lstma")!=null){
ds=(ArrayList<SachBean>)request.getAttribute("lstma");
}else
ds=(ArrayList<SachBean>)request.getAttribute("lsttk");
%>
<table>
<%int n= ds.size();
for(int i=0;i<n;i++){%>
<tr>
<td>
<img src='<%=ds.get(i).getAnh()%>'><br>
<%=ds.get(i).getTensach()%><br>
<%=ds.get(i).getTacgia()%><br>
<%=ds.get(i).getGia()%>
<a href="Mua?ms=<%=ds.get(i).getMasach()%>
&ts= <%=ds.get(i).getTensach()%>&gia=
<%=ds.get(i).getGia()%>">
Dat mua
</a>
</td>
<td>
<%i++;
if(i<n){%>
<img src='<%=ds.get(i).getAnh()%>'><br>
<%=ds.get(i).getTensach()%><br>
<%=ds.get(i).getTacgia()%><br>
<%=ds.get(i).getGia()%>
<a href="Mua?ms=<%=ds.get(i).getMasach()%>
&ts=<%=ds.get(i).getTensach()%>&gia=
<%=ds.get(i).getGia()%>">
Dat mua
</a>
</td>
<%} %>
</tr>
<%} %>
</table>
</td>
<td valign='top'>
<%@include file='Phai.jsp' %>
</td>
</tr>
</table>
</body>
</html>
Bài liên quan
<%=ds.get(i).getTensach()%>
<%=ds.get(i).getTacgia()%>
<%=ds.get(i).getGia()%> Dat mua
<%=ds.get(i).getTensach()%>
<%=ds.get(i).getTacgia()%>
<%=ds.get(i).getGia()%> Dat mua
Sửa lại post với code có format markdown nhé em.
e vẩn ko hĩu…sua form hã ah