1
下面的JSP代碼段:錯誤而將數據添加到HREF
<% while(set.next()) { %>
<li>
<%-- statement 3--%> <a class="thumb" href="/home/non-admin/project uploads/project users/" <% + %> <%= set.getString("UserEmail") %> <% + %> "/" <% + %> <%= set.getString("NameOfThePhoto") %> > <img src="images/portfolio_two/1_thumb.jpg" alt="one"> </a>
<div class="caption">
<div class="image-title portfolio_two">"Pier by the sea, Fowey, Cornwall, UK"</div>
</div>
</li>
<% } %>
給出了一個錯誤在聲明3。 IDE說not a statement
和"""""" is not serializable in xml 1.0
。這個錯誤是什麼,爲什麼會發生? 在聲明3中,我將從數據庫獲取的值添加到href。
這是怎麼回事所有'<% + %>'?這是一個有效的陳述? – BalusC