2015-10-20 44 views
-1

我的下面的代碼是給出錯誤!在spark.get(新幹線(「/」)。我是新來的火花任何幫助將讚賞??任何建議java:匿名類實現接口;不能有參數

public static void main(String[] args) { 
     final Configuration configuration=new Configuration(); 
     configuration.setClassForTemplateLoading(sparkclass.class,"/"); 
     final StringWriter writer=new StringWriter(); 
     Spark.get(new Route("/"){ 
      public Object handle(Request request, Response response) throws Exception { 
       Template helloTemplate=configuration.getTemplate("hello.ftl"); 

       HashMap<String,Object>mp=new HashMap<String, Object>(); 
       mp.put("name","Sumit"); 
       helloTemplate.process(mp,writer); 
       System.out.print(writer); 
       return writer; 
      } 
     }); 
    } 
+0

請發佈錯誤,否則很難猜測。 – Acapulco

+0

我推薦http://stackoverflow.com/help/how-to-ask –

+0

java:匿名類實現接口;不能有參數這是行號錯誤。 5 –

回答