📄 fcst.jsp
字号:
<%@ page contentType="text/html;charset=gb2312"%>
<%@ page import="java.util.*" %>
<jsp:useBean id="Utility" scope="session" class="wapserver.Utility"/>
<jsp:useBean id="Weather" scope="session" class="wapserver.Weather"/>
<%
//String line = Weather.GetLineByCity(cityName,"../WAPServer/jsp/db/");
String cityName = request.getParameter("cityName");
String path = request.getRealPath("/");
//System.out.println(cityName+path);
//out.println(Weather.findCity(cityName,path+"WAPServer\\jsp\\db\\"));
///test
Vector v = new Vector();
Vector v2 = new Vector();
v = (Vector)Weather.GetAll(cityName,path+"jsp/db/");
if(v.size()<=1){
v2 = (Vector)Weather.GetPreAll(cityName,path+"jsp/db/");
}
//System.out.println("v"+v);
//System.out.println("v2"+v2);
%>
<?xml version="1.0" encoding="GB2312"?>
<!DOCTYPE wml PUBLIC "-//WAPFORUM//DTD WML 1.1//EN" "http://www.wapforum.org/DTD/wml_1.1.xml">
<wml>
<card id = "main" title = "华风天气服务-<%=cityName%>">
<table>
<tr>
<td >
<p ><font color="#003366"><b>预报时间范围</b></font></p>
</td>
<td ><font color="#003366"><b>天气现象</b></font></td>
<td ><font color="#003366"><b>温度</b></font></td>
<td ><font color="#003366"><b>风力/风向</b></font></td>
</tr>
<%
if(v.size()>10){
for(int i = 1;i<6;i++){
%>
<tr >
<td><%=Utility.getDateString(i)%></td>
<td><%=Weather.Get_Weather(v,i)%><br/>
<%
if(!Weather.Get_Weather_B_Url(v,i).equals("")){
%>
<img src="<%=Weather.Get_Weather_B_Url(v,i)%>"/>
<%
}
if(!Weather.Get_Weather_B_Url(v,i).equals(Weather.Get_Weather_E_Url(v,i))){
%>
<img src="<%=Weather.Get_Weather_E_Url(v,i)%>"/>
<%
}
%>
</td>
<td><%=Weather.Get_Temp(v,i)%></td>
<td><%=Weather.Get_Wind(v,i)%></td>
</tr>
<%
}
}else{
for(int i = 0;i<5;i++){
%>
<tr >
<td><%=Utility.getDateString(i)%></td>
<td><%=Weather.Get_Weather(v2,i+1)%><br/>
<%
if(!Weather.Get_Weather_B_Url(v2,i+1).equals("")){
%>
<img src="<%=Weather.Get_Weather_B_Url(v2,i+1)%>"/>
<%
}
if(!Weather.Get_Weather_B_Url(v2,i+1).equals(Weather.Get_Weather_E_Url(v2,i+1))){
%>
<img src="<%=Weather.Get_Weather_E_Url(v2,i+1)%>"/>
<%
}
%>
</td>
<td><%=Weather.Get_Temp(v2,i+1)%></td>
<td><%=Weather.Get_Wind(v2,i+1)%></td>
</tr>
<%
}
}
%>
</table>
</card>
</wml>
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -