爪哇:
package com.test;
import spark.Request;
import spark.Response;
import spark.Route;
import spark.Spark;
public class HelloWorldSparkStyle {
public static void main(String[] args){
Spark.get(new Route("/") {
@Override
public Object handle(final Request request, final Response response) {
return "Hello from Spark";
}
});
}
}
在localhost:4567运行此代码会出现以下错误:
XML Parsing Error: syntax error
Location: http://localhost:4567/
Line Number 1, Column 1:
Hello from Spark
^