当前位置:编程学习 > html/css >>

axis WebServices 完美调用天气预报,查询、显示 代码!

axis WebServices 完美调用天气预报,查询、显示 代码!

效果:

 


jsp页面:


[html]
<%@ page language="java" import="java.util.*" pageEncoding="utf-8"%> 
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %> 
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">    
<html>    
    <head>   
    
        <title>城市天气信息</title>  
 
         
    </head>    
<style>    
body{    
    font-size:12px;    
}    
table{    
    border-collapse:sparate;    
    border-spacing:0px;    
}    
td{    
    padding:0px;    
    border:0px solid #000;    
    text-align:center;    
    font-size:12px;    
    color:#2A5CAA;    
    border-color:#2A5CAA;    
}    
.noMess{    
    text-align: center;    
    text-valign: center;    
}    
   
</style>      
    <body>   
     
    <form action="webservice.action" method="post" name="form1"> 
        <input type="text" name="city" /> <input type="submit" value="查询"  id="sub"/> 
    </form> 
    <br/> 
   
    <!-- 显示天气 --> 
    <c:if test="${not empty weathers}"> 
    <table border="0" cellpadding="0" cellspacing="0" width="380">    
       <tr>    
           <td>${weathers._regionFirst}  ${weathers._regionSecond} 72小时天气预报</td>    
           <td>最新上报时间:${weathers._reportTime}</td>    
       </tr>    
       <tr>    
           <td colspan="2">   
               <!-- 今天天气 -->   
               <table border="0" cellpadding="0" cellspacing="0">   
                <tr><td> 
               ${weathers._todayDetail}  
               </td></tr>   
                 
               <tr>    
                   <td>${weathers._todayDate}  ${weathers._todayTemperature}</td>    
               </tr>  
               
               <tr>    
                   <td> ${weathers._todayWind}</td>    
               </tr>    
               <tr>    
                   <td>    
                       <img src="./images/weather/${weathers._todayPic_1}"/>    
                          
                       <img src="./images/weather/${weathers._todayPic_2}">    
                   </td>    
               </tr>    
               <tr>    
                   <td></td>    
               </tr>    
               </table>    
           </td>    
       </tr>    
       <tr>    
           <td colspan="2">  
              <!-- 明天天气 -->   
               <table border="0" cellpadding="0" cellspacing="0">    
               <tr>    
                   <td>${weathers.

补充:web前端 , HTML/CSS  ,
CopyRight © 2022 站长资源库 编程知识问答 zzzyk.com All Rights Reserved
部分文章来自网络,