开发者社区> 问答> 正文

目的和解决方案whitelabel错误问题是什么?

我在Spring Boot中编写了代码,但运行时却无法正常工作。请不要谈论软件包,因为我已经做了所有事情,并请您就此问题帮助我。

非常感谢您的关注

这是我的Restcontroller课

@org.springframework.web.bind.annotation.RestController public class RestController { @Autowired StudentService studentService;

@RequestMapping(value = "/",method = RequestMethod.GET)
public ResponseEntity<List<Student>>getAll(){
    List<Student>getAll=studentService.getAll();
    return new ResponseEntity<List<Student>>(getAll, HttpStatus.OK);
}

} 这是我的控制器课

@Controller public class MyController {

    @RequestMapping("/")
    public String home(){

        return "index";
    }
}

并且也有存储库和服务类(带有接口)

这是我的主要角度代码

"use strict"

var app=angular.module('myApp',[]); 这是我的角度控制器课程

app.controller('myCtrl',['$scope','myFactory',function ($scope,userService) { var self=this; self.users=[];

getAllData();

function getAllData() {
    userService.getAllData()
        .then(function (value) {
            self.users=value;
        },function (reason) {
            console.log('Error');
        });
}

}]); 最后一个是我的角度服务

app.factory('myFactory',['$http','$q',function ($http,$q) { var uri='href="localhost:8080/"'; var factory={getAllData:getAllData};

return factory;


function getAllData() {
    var deferred=$q.defer();
    $http.get(uri)
        .then(function (response) {
            deferred.resolve(response.data);
        },function (reason) {
            deferred.reject(reason);
        });
    return deferred.promise;
}

}]); 亲爱的开发人员我在运行该项目时遇到了白色标签错误。不要知道但我认为这是角度编码中的问题。...也许...请帮助我解决该问题

还有一个是我的配置文件应用程序

@Configuration @EnableWebMvc public class MyConfiguration extends WebMvcConfigurerAdapter { @Override public void configureViewResolvers(ViewResolverRegistry registry) { InternalResourceViewResolver internalResourceViewResolver=new InternalResourceViewResolver(); internalResourceViewResolver.setPrefix("/WEB-INF/"); internalResourceViewResolver.setSuffix(".html"); registry.viewResolver(internalResourceViewResolver); }

@Override
public void addResourceHandlers(ResourceHandlerRegistry registry) {
    registry.addResourceHandler("/static/**").addResourceLocations("/static/");
}

}

spring.datasource.url=jdbc:mysql://localhost:3306/employee101 spring.datasource.username=root spring.datasource.password= 帮助我进行了与数据库没有连接的项目,它可以正常工作。我已打开登录页面(不是矿山弹簧登录页面-我是默认登录页面)。但毕竟它没有打开任何东西。只是向我显示WHITELABEL错误。我搜索了仅显示包装错误的所有Internet。但将我的演示应用程序类放在软件包的顶部。我的意思是,分类套餐就是这样-打包HHH.com.demo; 和其他课程都在该软件包中-HHH.COM.DEMO.BLA BLA BLA。请说解决方案不实施错误等级,或者其他无法证明错误的方式。我的意思是我需要使用它和解决方案,而不是远离它

谢谢您的关注!!!

问题来源于stack overflow

展开
收起
保持可爱mmm 2019-11-15 15:02:52 854 0
0 条回答
写回答
取消 提交回答
问答排行榜
最热
最新

相关电子书

更多
快速变化背景下,组织如何保持过程的稳定性 立即下载
快速变化背景下,组织如何保持过程的稳定性? 立即下载
阿里巴巴代码缺陷检测探索与实践 立即下载