我有一个spring boot rest web应用程序,它可以在嵌入式服务器上完美运行.但是,按照博客https://docs.spring.io/spring-boot/docs/current/reference/htmlsingle/#howto-create-a-deployable-war-file中提到的步骤后,我收到了404错误消息我发送resquest给服务器上的资源.我在本地使用了java 1.8.0_212并使用了java 1.8.0_131并在服务器上的tomcat 9上部署了我的应用程序.令我困惑的一件事是可以访问扩展CrudRepository的存储库.以下是我的申请入门点.
@SpringBootApplication
@ComponentScan(basePackages = "com.dbe.ref")
public class RefmsApplication extends SpringBootServletInitializer {
@Override
protected SpringApplicationBuilder configure(SpringApplicationBuilder builder) {
return builder.sources(RefmsApplication.class);
}
public static void main(String[] args) {
SpringApplication.run(RefmsApplication.class, args);
}
Run Code Online (Sandbox Code Playgroud)
还有我的pom.xml
<?xml version="1.0" encoding="UTF-8"?>
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>
<groupId>com.dbe.ref</groupId>
<artifactId>refms</artifactId>
<version>0.0.1-SNAPSHOT</version>
<packaging>war</packaging>
<name>refms</name>
<description>project for Rural electrification fund</description>
<parent>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-parent</artifactId>
<version>LATEST</version>
<relativePath/> <!-- lookup parent from repository -->
</parent>
<properties>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
<project.reporting.outputEncoding>UTF-8</project.reporting.outputEncoding>
<java.version>1.8</java.version>
<start-class>com.RefmsApplication</start-class>
</properties>
<dependencies>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-tomcat</artifactId>
<scope>provided</scope> …Run Code Online (Sandbox Code Playgroud) 我在c#中使用System.Windows.Forms.WebBrowser webBrowser1.想要为此浏览器发出的每个请求添加请求标头.
我试图更新queryPedometerDataFromDate(..)方法的处理程序内的UILabel文本.UILabel的更新在20或25秒后反映出来.但我几乎实时看到println()输出.有没有办法让它更快?如果我在此处理程序之外更新UILabel的文本,那么它会再次实时更新.
pedoman.queryPedometerDataFromDate(yester, toDate: now) {
(data:CMPedometerData!, errr:NSError!) -> Void in
//Below statement take 20 to 30 second to reflect on UILabel
self.StringSteps.text = data.numberOfSteps.stringValue
//Below statement prints on Output in real time.
println("Number of Steps \(data.numberOfSteps)")
}
Run Code Online (Sandbox Code Playgroud)