我用 Java 8 新创建了 springboot 批处理应用程序,我想仅使用注释为 springbatch 表创建一个数据库。
我想我必须创建配置文件,但我不知道该怎么做。
您可以在下面看到我想用注释在我的 java 程序中重现的所有配置:
<!-- Base de donnees H2 pour les tables Spring Batch -->
<jdbc:embedded-database id="springBatchDataSource" type="H2">
<jdbc:script location="org/springframework/batch/core/schema-drop-h2.sql" />
<jdbc:script location="org/springframework/batch/core/schema-h2.sql" />
</jdbc:embedded-database>
<!-- TransactionManager Spring Batch -->
<bean id="springBatchTransactionManager" class="org.springframework.batch.support.transaction.ResourcelessTransactionManager" />
<!-- JobRepository Spring Batch -->
<bean id="jobRepository" class="org.springframework.batch.core.repository.support.JobRepositoryFactoryBean">
<property name="dataSource" ref="springBatchDataSource" />
<property name="transactionManager" ref="springBatchTransactionManager" />
<property name="databaseType" value="H2" />
</bean>
Run Code Online (Sandbox Code Playgroud)
我添加了下面的代码:
@Configuration公共类ConfigBatch {
@Bean(destroyMethod = "shutdown")
public EmbeddedDatabase dataSourceH2() {
return new EmbeddedDatabaseBuilder().setType(EmbeddedDatabaseType.H2)
.addScript("classpath:org/springframework/batch/core/schema-drop-h2.sql")
.addScript("classpath:org/springframework/batch/core/schema-h2.sql").build();
}
@Bean …Run Code Online (Sandbox Code Playgroud) 我已经在带有“ frontend-maven-plugin”(V1.6)的tomcat服务器上部署了一个angular 4应用程序(带有角度路由),但是url组合非常奇怪。
实际上,当我单击所有页面上的刷新按钮时,就会出现HTTP 404错误。当我尝试在根页面上访问时,没有重定向到index.html。
这些错误仅在tomcat部署中出现(与nodejs配合正常)。
我如何配置tomcat来纠正此问题?
感谢您的回复。
我已经用bootstrap scrollspy组件转换了基本的html页面,但是我的导航不起作用(页面滚动时没有变化)。
我使用以下命令安装了bootstrap 4:
npm install bootstrap
Run Code Online (Sandbox Code Playgroud)
页面滚动没有变化,或者当我单击菜单时没有“活动”标志。
你能帮助我吗 ?谢谢 :)
angular ×2
bootstrap-4 ×1
h2 ×1
java ×1
maven ×1
scrollspy ×1
spring-batch ×1
spring-boot ×1
tomcat ×1
url-routing ×1