2012-05-04 36 views
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">&quot;Pier by the sea, Fowey, Cornwall, UK&quot;</div> 
      </div> 
</li> 
<% } %> 

給出了一個錯誤在聲明3。 IDE說not a statement"""""" is not serializable in xml 1.0。這個錯誤是什麼,爲什麼會發生? 在聲明3中,我將從數據庫獲取的值添加到href。

+0

這是怎麼回事所有'<% + %>'?這是一個有效的陳述? – BalusC

回答

2

我給它一個鏡頭。但是,我仍然不喜歡「項目上傳」和「項目用戶」中的空間。

href="/home/non-admin/project uploads/project users/<%=set.getString("UserEmail")%>/<%=set.getString("NameOfThePhoto")%>"