小编gkc*_*123的帖子

Rest Controller无法识别Spring Boot App中的GET请求

我正在尝试使用Spring Boot实现简单的演示MVC应用程序,但在执行应用程序时出现404错误.uri是` http:// localhost:8080 / ',它显示名为circle的表中的所有行.

  • Spring Boot:1.3.3.RELEASE
  • Java版本:1.8.0_65
  • 数据库:Apache Derby 10.12.1.1

Maven Java项目:

Maven Java项目结构

Application.java

package com.nomad.dubbed.app;

import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;

@SpringBootApplication
public class Application  {

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

}
Run Code Online (Sandbox Code Playgroud)

CircleController.java

package com.nomad.dubbed.controller;

import java.util.List;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.RestController;

import com.nomad.dubbed.dao.CircleService;
import com.nomad.dubbed.model.Circle;

@RestController
@RequestMapping("/")
public class CircleController {
    @Autowired
    private CircleService circleService;

    @RequestMapping(method=RequestMethod.GET)
    public List<Circle> getAll() {
        return circleService.getAll();
    }

}
Run Code Online (Sandbox Code Playgroud)

CircleRepository.java

package com.nomad.dubbed.dao;

import org.springframework.data.jpa.repository.JpaRepository;
import org.springframework.stereotype.Repository;

import com.nomad.dubbed.model.Circle; …
Run Code Online (Sandbox Code Playgroud)

java spring-mvc maven spring-boot spring-restcontroller

6
推荐指数
3
解决办法
2万
查看次数

为了获得最佳 MapReduce 作业性能,HDFS 中的文件大小应该是多少

我想将文本文件从外部源复制到 HDFS。让我们假设我可以根据文件的大小组合和拆分文件,文本文件的大小应该是什么才能获得最佳的自定义 Map Reduce 作业性能。大小重要吗?

filesystems hadoop mapreduce hdfs

3
推荐指数
1
解决办法
3066
查看次数