调试Angular应用程序POST请求

时间:2018-10-08 19:35:59

标签: spring angular spring-boot angular6

我有带有登录表单的Angular应用程序,该应用程序已连接到独立的Spring应用程序。

我将Spring代码编辑为可在Wildfly服务器中部署。但是,当我启动Angular应用程序并尝试发送请求时,只能在控制台中看到

[HPM] POST / api / oauth / token-> http://localhost:8080

没有错误。我如何找到问题?我想我的应用程序启动方法不正确,并且Web服务无法运行:

@SpringBootApplication(scanBasePackages = { "org.admin.*", "org.plugin.service" })
@EntityScan("org.datalis.plugin.entity")
public class Application extends SpringBootServletInitializer implements WebMvcConfigurer {

    @Override
    protected SpringApplicationBuilder configure(SpringApplicationBuilder application) {
        return application.sources(Application.class);
    }

    public static void main(String[] args) {
        SpringApplication.run(Application.class, args);
    }
}

在日志文件中,我可以看到端点已注册:

2018-10-08 12:32:19,060 INFO  [org.springframework.web.servlet.mvc.method.annotation.RequestMappingHandlerMapping] (ServerService Thread Pool -- 81) Mapped "{[/transactions/{id}],methods=[GET]}" onto public org.springframework.http.ResponseEntity<?> org.datalis.admin.backend.restapi.PaymentTransactionsController.get(java.lang.String)
2018-10-08 12:32:19,061 INFO  [org.springframework.web.servlet.mvc.method.annotation.RequestMappingHandlerMapping] (ServerService Thread Pool -- 81) Mapped "{[/transactions/{id}],methods=[POST]}" onto public org.springframework.http.ResponseEntity<?> org.datalis.admin.backend.restapi.PaymentTransactionsController.save(java.lang.String,org.datalis.admin.backend.restapi.dto.PaymentTransactionsDTO)
2018-10-08 12:32:19,064 INFO  [org.springframework.web.servlet.mvc.method.annotation.RequestMappingHandlerMapping] (ServerService Thread Pool -- 81) Mapped "{[/transactions],methods=[POST]}" onto public org.springframework.http.ResponseEntity<?> org.datalis.admin.backend.restapi.PaymentTransactionsController.create(org.datalis.admin.backend.restapi.dto.PaymentTransactionsDTO)
2018-10-08 12:32:19,065 INFO  [org.springframework.web.servlet.mvc.method.annotation.RequestMappingHandlerMapping] (ServerService Thread Pool -- 81) Mapped "{[/transactions],methods=[GET]}" onto public org.springframework.data.domain.Page<org.datalis.admin.backend.restapi.dto.PaymentTransactionsDTO> org.datalis.admin.backend.restapi.PaymentTransactionsController.find(org.datalis.admin.backend.restapi.dto.PaymentTransactionsFilterDTO,org.springframework.data.domain.Pageable)
2018-10-08 12:32:19,069 INFO  [org.springframework.web.servlet.mvc.method.annotation.RequestMappingHandlerMapping] (ServerService Thread Pool -- 81) Mapped "{[/transactions/export],methods=[GET]}" onto public void org.datalis.admin.backend.restapi.PaymentTransactionsController.export(javax.servlet.http.HttpServletResponse)
2018-10-08 12:32:19,073 INFO  [org.springframework.web.servlet.mvc.method.annotation.RequestMappingHandlerMapping] (ServerService Thread Pool -- 81) Mapped "{[/transactions/types],methods=[GET]}" onto public org.springframework.http.ResponseEntity<?> org.datalis.admin.backend.restapi.PaymentTransactionsController.getTypes()
2018-10-08 12:32:19,078 INFO  [org.springframework.web.servlet.mvc.method.annotation.RequestMappingHandlerMapping] (ServerService Thread Pool -- 81) Mapped "{[/users/reset],methods=[POST]}" onto public org.springframework.http.ResponseEntity<?> org.datalis.admin.backend.restapi.UserController.reset(org.datalis.admin.backend.restapi.dto.PasswordResetDTO)
2018-10-08 12:32:19,079 INFO  [org.springframework.web.servlet.mvc.method.annotation.RequestMappingHandlerMapping] (ServerService Thread Pool -- 81) Mapped "{[/users/token],methods=[POST]}" onto public org.springframework.http.ResponseEntity<?> org.datalis.admin.backend.restapi.UserController.token(org.datalis.admin.backend.restapi.dto.PasswordResetDTO)
2018-10-08 12:32:19,080 INFO  [org.springframework.web.servlet.mvc.method.annotation.RequestMappingHandlerMapping] (ServerService Thread Pool -- 81) Mapped "{[/users/request],methods=[POST]}" onto public org.springframework.http.ResponseEntity<?> org.datalis.admin.backend.restapi.UserController.resetRequest(org.datalis.admin.backend.restapi.dto.PasswordResetDTO)
2018-10-08 12:32:19,092 INFO  [org.springframework.web.servlet.mvc.method.annotation.RequestMappingHandlerMapping] (ServerService Thread Pool -- 81) Mapped "{[/error]}" onto public org.springframework.http.ResponseEntity<java.util.Map<java.lang.String, java.lang.Object>> org.springframework.boot.autoconfigure.web.servlet.error.BasicErrorController.error(javax.servlet.http.HttpServletRequest)
2018-10-08 12:32:19,093 INFO  [org.springframework.web.servlet.mvc.method.annotation.RequestMappingHandlerMapping] (ServerService Thread Pool -- 81) Mapped "{[/error],produces=[text/html]}" onto public org.springframework.web.servlet.ModelAndView org.springframework.boot.autoconfigure.web.servlet.error.BasicErrorController.errorHtml(javax.servlet.http.HttpServletRequest,javax.servlet.http.HttpServletResponse)

0 个答案:

没有答案