我在jsp中有以下代码,我不想删除java代码并用struts2替换它:
WeatherService weatherService = new WeatherService();
List<WeatherModel> list = weatherService.getList();
%>
<h1>WEATHER</h1>
<br>
<br>
Current Weather
<table border="1">
<tr>
<td>MinTemp</td>
<td>MaxTemp</td>
<td>Date</td>
</tr>
<tr>
<td><%=list.get(0).getMinTemp() %>°C</td>
<td><%=list.get(0).getMaxTemp() %>°C</td>
<td><%=list.get(0).getDate() %></td>
</tr>
<s:form action="getWeather">
<s:submit value="Refresh" />
</s:form></table>
<br><br>
Past Weather
<br><br>
<table border="2">
<%
for(int i=1;i<list.size();++i) {
%>
<tr>
<td><%=list.get(i).getDate() %></td>
<td>
<s:form acton="delete">
<s:hidden name="date" value="%{#list.get(i).getDate()}"/>
<s:submit value="Delete"/>
</s:form>
</td>
<td>
<s:form action="viewWeather">
<s:submit value="View"/>
</s:form>
</td>
</tr>
<%} %>
有人可以更正此代码,从中删除所有的Java代码吗? 我无法发布这个问题,因为它必须包含大量代码并且描述不多,所以这里不仅仅是代码文本:aaaaaaaaaaaaa aaaaaaaaaaaaaaaaa aaaaaaaaaaaaaaa AAAAAAAAAAAA