-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;
}
});
}
请发布错误,否则很难猜测。 – Acapulco
我推荐http://stackoverflow.com/help/how-to-ask –
java:匿名类实现接口;不能有参数这是行号错误。 5 –