TomcatEmbeddedServletContainerFactory在Spring Boot 2中缺失(TomcatEmbeddedServletContainerFactory is missing in Spring Boot 2)
我有Spring Boot应用程序版本1.5.x,它使用
org.springframework.boot.context.embedded.tomcat.TomcatEmbeddedServletContainerFactory
,我试图将它迁移到Spring Boot 2,但该应用程序不编译,虽然有一个依赖项到org.springframework.boot:spring-boot-starter-tomcat
。 编译器发出以下错误:error: package org.springframework.boot.context.embedded.tomcat
I have Spring Boot application version 1.5.x, which uses
org.springframework.boot.context.embedded.tomcat.TomcatEmbeddedServletContainerFactory
, I'm trying to migrate it to Spring Boot 2, but the app does not compile, although a have a dependency toorg.springframework.boot:spring-boot-starter-tomcat
. The compiler issues the error below:error: package org.springframework.boot.context.embedded.tomcat
原文:https://stackoverflow.com/questions/47700115
最满意答案
评论中列出的副本( 获取下一年的星期一和星期二的所有日期 )有一个相当详细的答案。 以下是使用
strtotime
和相对格式的简洁解决方案:// Initialize our dates to UNIX timestamps $startDate = strtotime( 'next Tuesday', strtotime($startDate) ); $endDate= strtotime($endDate); // Output all Tuesdays prior to our end date while ($startDate < $endDate) { echo date('n/j/Y', $startDate ). "\n"; // Get next Tuesday relative to last Tuesday $startDate = strtotime( 'next Tuesday', $startDate ); }
使用今天(
$startDate
)和今天2个月($endDate
)作为例子,上面的输出:4/17/2012 4/24/2012 5/1/2012 5/8/2012 5/15/2012 5/22/2012 5/29/2012 6/5/2012
注意 :确保使用正确的日期格式以获得准确的结果。
The duplicate listed in the comments ( Getting all dates for Mondays and Tuesdays for the next year ) has a rather verbose answer. Here is a succinct solution using
strtotime
with Relative Formats:// Initialize our dates to UNIX timestamps $startDate = strtotime( 'next Tuesday', strtotime($startDate) ); $endDate= strtotime($endDate); // Output all Tuesdays prior to our end date while ($startDate < $endDate) { echo date('n/j/Y', $startDate ). "\n"; // Get next Tuesday relative to last Tuesday $startDate = strtotime( 'next Tuesday', $startDate ); }
Using today (
$startDate
) and 2 months from today ($endDate
) as an example, the above outputs:4/17/2012 4/24/2012 5/1/2012 5/8/2012 5/15/2012 5/22/2012 5/29/2012 6/5/2012
Note: Ensure you are using a proper date format to receive accurate results.
相关问答
更多-
评论中列出的副本( 获取下一年的星期一和星期二的所有日期 )有一个相当详细的答案。 以下是使用strtotime和相对格式的简洁解决方案: // Initialize our dates to UNIX timestamps $startDate = strtotime( 'next Tuesday', strtotime($startDate) ); $endDate= strtotime($endDate); // Output all Tuesdays prior to our end date w ...
-
如何获得python中两个日期之间的所有日期(月,日和年)?(How to get all dates (month, day and year) between two dates in python?)[2022-03-09]
你不必重新发明轮子。 只需将字符串解析为datetime对象并让python为您做数学运算: from dateutil import rrule from datetime import datetime a = '20120525' b = '20120627' for dt in rrule.rrule(rrule.DAILY, dtstart=datetime.strptime(a, '%Y%m%d'), u ... -
我想出了这个: from datetime import date, timedelta d1 = date(2008, 8, 15) # start date d2 = date(2008, 9, 15) # end date delta = d2 - d1 # timedelta for i in range(delta.days + 1): print(d1 + timedelta(days=i)) 输出: 2008-08-15 2008-08-16 ... 200 ...
-
MySQL日期之间的日期(MySQL Dates between Dates)[2022-03-30]
约旦, 这不是MySQL 4直接可能的。我认为这个逻辑不应该放在你的数据库层。 然而,有关StackOverflow的问题涉及到你的问题,解决方案是一个存储过程(但是你需要mysql 5)。 在此处查看: 获取两个日期之间的日期列表 我发现一个不准备使用,但在这个网页上的PHP的问题明智的方法: http : //prajapatinilesh.wordpress.com/2009/05/07/get-all-dates-between-two-dates-使用-PHP-代码/ 希望这能帮助你朝正确的方向发 ... -
如何创建递归查询以获取两个日期之间的所有日期(How to create recursive query to get all dates between two dates)[2022-03-03]
你需要递归CTE: DECLARE @arrival_date date = '2016-01-01', @leaving_date date = '2016-02-01' ;WITH cte AS ( SELECT @arrival_date as date_ UNION ALL SELECT CAST(DATEADD(day,1,date_) as date) FROM cte WHERE date_ < @leaving_date ) SELECT * FROM cte OPT ... -
查找Linux机器上两个日期之间修改的文件[关闭](Find files modified between two dates on Linux machine [closed])[2023-07-19]
如果您想在Unix命令行上执行此操作,请尝试使用带-mtime选项的find。 例: find /home -iname ".c" -mtime 2 -mtime -4 将选择两到四天前修改的文件。 If you want to do it on the Unix command line, try using find with the -mtime option. Example: find /home -iname ".c" -mtime 2 -mtime -4 will choose files ... -
尝试这个。 我假设你正在使用TSQl(不确定你是否也标记了SQL。 ;WITH cte_result(ID,Ref, Period,Phase,StDt,EndDt) AS ( SELECT 1,'013' ,3,'KAA',CAST('01/01/16'AS DATETIME),CAST('01/01/16'AS DATETIME) UNION ALL SELECT 2,'013' ,3,'TAA','01/02/16','01/03/16' UNION ALL SELECT 3,'013' ,3,'K ...
-
你应该尝试使用Calendar ,这将允许你从一个日期走到另一个日期...... Date fromDate = ...; Date toDate = ...; System.out.println("From " + fromDate); System.out.println("To " + toDate); Calendar cal = Calendar.getInstance(); cal.setTime(fromDate); while (cal.getTime().before(toDate) ...
-
第二个例子中的日期数学是错误的 - 在该范围内有24天,而不是22天。 我可以在一个假期期间到达那里: 让: A1包含假期开始(2012年12月11日) A2包含假期结束(2013年1月7日) B1包含开始日期 B2包含结束日期 式: =MAX(MIN(A2+1,B2+1),A1) - MIN(MAX(A1,B1),A2+1) 该公式基本上找到重叠的日期范围(如果有的话),并减去以获得整天的数量。 “+1”是因为您的“结束日期”实际上是包容性的,因此对于日期数学,您需要让假期在1月8日结束,而不是1月7日 ...
-
编辑:好的,现在我看到更多关于你想要实现的目标。 所以你有输入: 开始日期和结束日期 月/日对列表。 目前你实际上没有这个,但这是你在逻辑上得到的。 您当前的代码没有考虑到可能存在多年的事实。 首先,让我们适当地转换您的数据表: var monthDays = dateTypeList.Rows.AsEnumerable() .Select(row => new { Month = row.Field
("Month") ...