Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <%@taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core"%>
- <%@taglib prefix = "x" uri = "http://java.sun.com/jsp/jstl/xml" %>
- <html>
- <style>
- body {
- font-family: "Segoe UI";
- }
- th, td, tr {
- padding: 1pt 3pt 1pt 3pt;
- text-align: center;
- }
- </style>
- <body>
- <h2>IP</h2>
- <c:if test="${not empty lists}">
- <ul>
- <c:out value="<hosts>"/>
- <c:forEach var="listValue" items="${lists}">
- <p>
- <c:out value="<host name=\"${listValue.name}\">
- <ip>${listValue.ip}</ip>
- </host>"/>
- </p>
- </c:forEach>
- <c:out value="</hosts>"/>
- </ul>
- </c:if>
- <h3>Weather forecast:</h3>
- <c:import var = "xmltext" url="https://query.yahooapis.com/v1/public/yql?q=select%20*%20from%20weather.forecast%20where%20woeid%20in%20(select%20woeid%20from%20geo.places(1)%20where%20text%3D%22nome%2C%20ak%22)&format=xml&env=store%3A%2F%2Fdatatables.org%2Falltableswithkeys"/>
- <x:parse doc = "${xmltext}" var = "output"/>
- <table>
- <tr>
- <th><b>Date:</b></th>
- <x:forEach select = "$output//attribute::date" var = "item">
- <th>
- <x:out select = "$item" />
- </th>
- </x:forEach>
- </tr>
- <tr>
- <th><b>High:</b></th>
- <x:forEach select = "$output//attribute::high" var = "item">
- <td>
- <x:out select = "$item" />
- </td>
- </x:forEach>
- </tr>
- <tr>
- <th><b>Low:</b></th>
- <x:forEach select = "$output//attribute::low" var = "item">
- <td>
- <x:out select = "$item" />
- </td>
- </x:forEach>
- </tr>
- <tr>
- <th><b>Description:</b></th>
- <x:forEach select = "$output//attribute::text" var = "item">
- <td>
- <x:out select = "$item" />
- </td>
- </x:forEach>
- </tr>
- </table>
- </body>
- </html>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement