2 donghao19944 donghao19944 于 2016.09.19 11:31 提问

大神们有没有什么思路 1C

这四个注释下面分别填写的内容 时间分别为today 3days week month
图片说明

3个回答

qq_28510593
qq_28510593   2016.09.19 11:37

package com.oracle.servlet;

import java.io.IOException;
import java.util.List;

import javax.servlet.ServletException;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;

import com.oracle.domain.Book;
import com.oracle.domain.Category;
import com.oracle.service.BaseServlet;
import com.oracle.service.BookService;
import com.oracle.service.CategoryService;

public class BookServlet extends BaseServlet {
BookService bookService=new BookService();
public String findAll(HttpServletRequest request, HttpServletResponse response)
throws ServletException, IOException {
List booklist = bookService.findAll();
request.setAttribute("booklist", booklist);
return "f:/jsps/book/list.jsp";
}
public String findByCid(HttpServletRequest request, HttpServletResponse response)
throws ServletException, IOException {
String cid = request.getParameter("cid");
List booklist = bookService.findByCid(cid);
request.setAttribute("booklist", booklist);
return "f:/jsps/book/list.jsp";
}

public String findByBid(HttpServletRequest request, HttpServletResponse response)
        throws ServletException, IOException {
    String bid = request.getParameter("bid");
     Book book = bookService.findByBid(bid);
     System.out.println(book);
    request.setAttribute("book", book);
    return "f:/jsps/book/desc.jsp";
}

}

shihengzhen101
shihengzhen101   Rxr 2016.09.19 11:48

楼上就是一份代码瞎粘一通啊,在好几个帖子看到你了

我不太明白楼主的意思,你是要补全代码吗?

donghao19944
donghao19944 回复AlbertS: timeFilter为String类型
大约一年之前 回复
shihengzhen101
shihengzhen101 你的代码不全啊,timeFilter的类型也没有说明
大约一年之前 回复
donghao19944
donghao19944 对 我是要补全代码 但是没有什么思路
大约一年之前 回复
donghao19944
donghao19944   2016.09.19 14:20
//处理timeFilter
    String timeFilter = noticeForm.getTimeFilter();
    if(!TextUtils.isBlank(timeFilter)){
        //timeFilter 不为空/
        //判断timeFiter值
        if(timeFilter.equals("today")){
            new Date();
        }

            //DateUtils.addMonths(new Date(),-1);
            //org.apache.commons.lang.time.DateUtils.addWeeks()
            //.create_ime>:createTime

            //      params.set

        //根据timeFilter获取相应时间

        //sb中添加创建时间大于获取的相应时间
Csdn user default icon
上传中...
上传图片
插入图片
准确详细的回答,更有利于被提问者采纳,从而获得C币。复制、灌水、广告等回答会被删除,是时候展现真正的技术了!