showall.jsp
来自「本软件系统可以实现预定酒店的多方位查询、预订酒店的功能。可以方便人们入住酒店,增」· JSP 代码 · 共 74 行
JSP
74 行
<%@ page contentType="text/html;charset=GBK"%>
<%@ page import="com.abc.hotel.*,javax.rmi.*"%>
<html>
<head>
<title>showall.jsp</title>
</head>
<body>
<%
Collection collection= (Collection)request.getAttribute("session_findAll");
//房间类型查询
HouseTypeRemoteHome houseTypeRemoteHome = (HouseTypeRemoteHome)request.getAttribute("session_houseTypeRemoteHome");
if (collection.size() == 0){
%>
没有查询到相应的记录!
<%}else{
Iterator it=collection.iterator();
while (it.hasNext()){
Object object = it.next();
HotelRemote hotelRemote = (HotelRemote)PortableRemoteObject.narrow(object,HotelRemote.class);//造型
Integer hotelid = (Integer)hotelRemote.getPrimaryKey();//得到宾馆的ID
//根据hotelid查询房间信息
Collection collection_houseTypeRemoteHome = houseTypeRemoteHome.findByHotelId(hotelid);
Iterator it_sub=collection_houseTypeRemoteHome.iterator();
%>
<HR color=#cccccc noShade SIZE=1 width="95%">
<table border="1" width="100%" bordercolor="#FFFFFF" cellspacing="0" cellpadding="0">
<tr>
<td width="33%" rowspan="3"><img border="0" src="<%=request.getContextPath()%>/image/<%=hotelRemote.getPic()%>" width="150" height="130"></td>
<td width="33%">{name}<a href="<%=request.getContextPath()%>/HotelServlet?action=findone&hotelid=<%=hotelid%>"><%=hotelRemote.getName()%></a></td>
<td width="34%">{hotel level}<%=hotelRemote.getHotelLevel()%></td>
</tr>
<tr>
<td width="67%" colspan="2">{descr}<%=hotelRemote.getHotelDesc()%></td>
</tr>
<tr>
<td width="67%" colspan="2">{address}<%=hotelRemote.getAddress()%></td>
</tr>
</table>
<table border="0" width="100%" cellspacing="0" cellpadding="0">
<tr>
<td width="25%" bgcolor="#C0C0C0">房间类型</td>
<td width="25%" bgcolor="#C0C0C0">门市价</td>
<td width="25%" bgcolor="#C0C0C0">会员价</td>
<td width="25%" bgcolor="#C0C0C0">早餐情况</td>
</tr>
<%
//输出房间类型信息
while(it_sub.hasNext()){
Object obj = it_sub.next();
HouseTypeRemote houseTypeRemote = (HouseTypeRemote)PortableRemoteObject.narrow(obj,HouseTypeRemote.class);
%>
<tr>
<td width="25%"><%=houseTypeRemote.getHouseName()%></td>
<td width="25%"><%=houseTypeRemote.getNormalPrice()%></td>
<td width="25%"><%=houseTypeRemote.getVipPrice()%></td>
<td width="25%"><%=houseTypeRemote.getBreakfast()%></td>
</tr>
<%
}
%>
</table>
<p><br>
</p>
<HR color=#cccccc noShade SIZE=1 width="95%">
<%}}%>
</body>
</html>
⌨️ 快捷键说明
复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?