Home  >  Article  >  Web Front-end  >  How can I get different values ​​of the same field (same attribute) in an action in the SSH framework? _html/css_WEB-ITnose

How can I get different values ​​of the same field (same attribute) in an action in the SSH framework? _html/css_WEB-ITnose

WBOY
WBOYOriginal
2016-06-24 12:25:461070browse

Just like the title.
I design an inventory myself. The entity class has fields private Date date_time; // Date
I want to add the following to the jsp page: start date:


End date:


These two date values ​​are assigned to two variables, and then the inventory information in the time period is obtained: Date date_time1=stock.getDate_time();
Date date_time2=stock.getDate_time( );
List list=stockService.getStockByMonth(date_time1, date_time2);
if(list!=null){
session.put("srockList", list);
session.put(" msg", "Query successful");
return "showStock";
}else{
return "error";
}
What should I do? Please help me. I am new to SSH and I can’t figure out some things. Baidu is sometimes not very helpful. . .


Reply to the discussion (solution)

You are using vo and po as one. If you want to annotate it, you can use @Transient annotation and it will be fine. 🎜>
@Transient
private Date date_time_temp;
If you use the same name, you can define it as a Date array, but you have to separate vo and po, ​​which means you have to create two classes

Statement:
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn