2016-07-28 5 views
0

こんにちは、私はばねの角度のアプリケーションを実行するとGET http://localhost:8080/cyclone/admin/admin/cycle 404 (Not Found)を表示しています。私は第2の管理者がどこから来たのか分かりません。角度経路テンプレートが見つかりません404

アクセスURL <a href="#/cycle">Cycle</a>WEB-INF/views/admin/cycle.html

角度ルート設定の下のhtmlページ

App.config(['$routeProvider', function ($routeProvider) { 
     $routeProvider.when('/cycle', { 
      templateUrl: 'admin/cycle.html', 
      controller: 'CycleController' 
     }); 
    }]); 

マイ春コントローラ

@Controller 
    @RequestMapping(value = "/admin") 
    public class AdminController { 
      @RequestMapping("/cycle.html") 
     public String getCarPartialPage() { 
      return "admin/cycle"; 
     } 
    } 
+0

中に実際に 'のURLでadmin'は... – boycod3

+0

2回追加された私は、このリンクがエラーを達成するためにあなたを助けるかもしれないと思うhttp://stackoverflow.com/questions/24388634/ ajax-routing-calling-controller-name-twice – SakthiSureshAnand

答えて

1

変更

$routeProvider.when('/cycle', { 
    templateUrl: 'cycle.html', 
    controller: 'CycleController' 

}以下のようなコード)。

とスプリングコントローラ

@RequestMapping(value = "/cycle.html", method = RequestMethod.GET) 
public String getCarPartialPage() { 
return "admin/cycle"; 
} 
0

返すようにgetCarPartialPage()メソッドを変更します」サイクル "

+0

返信からadminを削除すると、テンプレートが表示されているか、設定されているテンプレートリゾルバでアクセスできない可能性があります – boycod3

関連する問題