2012-05-04 37 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")%>"