ラファエルObadia:
私は私が私の見解で私のAPI関数の戻り値を表示する必要がある、私の見解に苦しんでいます:
春コントローラコード
@Controller
public class mainController {
@RequestMapping(value = {"/"}, method = RequestMethod.GET)
public String index() throws IOException, GeneralSecurityException {
DriveQuickstart drive = new DriveQuickstart("c:/temp/credentials.json");
String res = drive.checkFile("cwg");
return res;
drive.checkFile
返すAPI関数ですString
。
私は私のビューに表示する必要がありますindex.html
。どうもうありがとう。
TheSprinter:
あなたの方法は、以下のように更新します。
@RestController
public class mainController {
@RequestMapping(value = "/", method = RequestMethod.GET)
public String index() throws IOException, GeneralSecurityException {
DriveQuickstart drive = new DriveQuickstart("c:/temp/credentials.json");
String res = drive.checkFile("cwg");
return res;
}
私が行った変更は、次のとおりです。置き換える@Controller
と@RestController
し、更新します@RequestMapping