Após atualizar o struts2 de 2.3.16 para 2.3.32 (consertar o S2-045), o arquivo JSP não pode resolver os campos de alguns objetos
Recentemente consertamos os struts2'S2-045' problem.I atualizei todos osstruts2
arquivos jar relacionados, incluindofreemarker
, ognl
, xWork
etc. eu usotomcat8
para implantar meu projeto dinâmico da web. Não havia nenhumExceptions
ao iniciar o servidor tomcat. Mas algunsproblemas pareceu ocorrer: alguns valores (obtidos de db) devem ser exibidos nas páginas jspdose não aparecer mais. Não háExceptions
jogado. Também posso observar que já obtive os objetos corretamente noAction Classes
.
// index.jsp ----- here is the list I want to show on the page.
// the list is the type of List<News> (Class News is my bussiness Class).
// I want to get the 'fTitle' and 'fCreatetime_s' from 'News' but they
// do not show up! (This used to be working very well.)
<s:bean name="org.ulibrary.web.Getarclist">
<s:iterator value="list">
<li>
<span class="listTitle">
<a target="_blank" href="ViewArc.action? uuid=${UUID}">${fTitle}</a>
</span>
<span class="listDate">${fCreatetime_s}</span>
</li>
</s:iterator>
</s:bean>
//=================================================================
A seguir, estão os campos com ID id News.java
// News.java (**just some ralated fields**)
class News{
@Id
@GeneratedValue(generator = "system-uuid")
@GenericGenerator(name = "system-uuid", strategy = "uuid")
@Column(name = "f_uuid", length = 32, unique = true)
private String UUID;
@Column(name = "f_title", length = 200)
private String fTitle;
@Transient
private String fCreatetime_s;
public String getUUID() {
return UUID;
}
public void setUUID(String uuid) {
UUID = uuid;
}
public String getFTitle() {
return fTitle;
}
public void setFTitle(String title) {
fTitle = title;
}
public String getFCreatetime_s() {
SimpleDateFormat formatter = new SimpleDateFormat("yyyy-MM-dd");
return formatter.format(Long.valueOf(fCreatetime));
}
public void setFCreatetime_s(String createtime_s) {
fCreatetime_s = createtime_s;
}
}
e então oGetarcList.java
//GetarcList.java (just include some related fields)
class GetarcList{
private List list;
public void setList(List list) {
this.list = list;
}
//!!!!!!$$$$--- Attention -----$$$$$!!!!!!!!!!!
// this method returns a List<News> , I can successfully get every value of 'News' in the list
public List getList() throws AuctionException{
String orderby_str = (String) OrderByMap.get(String.valueOf(orderby));
list = webTagManager.getArcList(row, typeid, titlelen, infolen, orderby_str + " " + orderway);
return list;
}
}
Eu acho que isso pode ser causado pelos arquivos jar relacionados ao OGNL ou JSP. Não encontrei nenhum problema no meuindex.jsp
ou arquivos java.