| | |
| | | import java.util.Date; |
| | | import java.util.Locale; |
| | | |
| | | public class ActionUtil{ |
| | | public class ActionUtil { |
| | | |
| | | public static String time_yyyyMMddHHmmss = "yyyy-MM-dd HH:mm:ss"; |
| | | public static String time_yyyyMMdd = "yyyy-MM-dd"; |
| | | public static String time_yyyyMMdd_HH_mm_ss = "yyyy-MM-dd_HH_mm_ss"; |
| | | public static SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss"); |
| | | public static SimpleDateFormat sdfwithOutday = new SimpleDateFormat("yyyy_MM"); |
| | | public static SimpleDateFormat sdfwithday = new SimpleDateFormat("yyyy-MM-dd"); |
| | | public static SimpleDateFormat sdfwithtime = new SimpleDateFormat("HH:mm:ss"); |
| | | public static SimpleDateFormat sdfwithtime_yyyyMMdd_HH_mm_ss = new SimpleDateFormat(time_yyyyMMdd_HH_mm_ss); |
| | | |
| | | /* |
| | | * 获取HttpServletRequest |
| | | */ |
| | | public static HttpServletRequest getRequest(){ |
| | | public static HttpServletRequest getRequest() { |
| | | ServletRequestAttributes requestAttributes = (ServletRequestAttributes) RequestContextHolder.getRequestAttributes(); |
| | | HttpServletRequest request = requestAttributes.getRequest(); |
| | | return request; |
| | | } |
| | | |
| | | |
| | | /* |
| | | * 获取HttpServletResponse |
| | | */ |