=htp a few small things that got lost in the #17988 merge
This commit is contained in:
parent
26d2910b68
commit
58e78757de
5 changed files with 13 additions and 21 deletions
|
|
@ -4,14 +4,11 @@
|
|||
|
||||
package docs.http.javadsl.server;
|
||||
|
||||
import akka.http.javadsl.model.HttpRequest;
|
||||
import akka.http.javadsl.model.StatusCodes;
|
||||
import akka.http.javadsl.server.*;
|
||||
import akka.http.javadsl.server.values.Parameters;
|
||||
import akka.http.javadsl.server.values.PathMatcher;
|
||||
import akka.http.javadsl.server.values.PathMatchers;
|
||||
import akka.http.javadsl.testkit.JUnitRouteTest;
|
||||
import akka.http.javadsl.testkit.TestRoute;
|
||||
import org.junit.Test;
|
||||
|
||||
public class PathDirectiveExampleTest extends JUnitRouteTest {
|
||||
|
|
@ -82,9 +79,4 @@ public class PathDirectiveExampleTest extends JUnitRouteTest {
|
|||
);
|
||||
//#path-examples
|
||||
}
|
||||
|
||||
// FIXME: remove once #17988 is merged
|
||||
public static <T> Route handleWith1(RequestVal<T> val, Object o) {
|
||||
return null;
|
||||
}
|
||||
}
|
||||
|
|
@ -64,7 +64,8 @@ about the number of handled arguments easier. For example, a :class:`Handler1[St
|
|||
``Function2[RequestContext, String, RouteResult]``. You can think of handlers as hot-dogs, where each ``T``
|
||||
type represents a sausage, put between the "buns" which are ``RequestContext`` and ``RouteResult``.
|
||||
|
||||
In Java 8 handlers can be provided as function literals or method references. The example from before then looks like this:
|
||||
In Java 8 handlers can be provided as function literals or method references. The previous example can then be written
|
||||
like this:
|
||||
|
||||
.. includecode:: /../../akka-http-tests-java8/src/test/java/docs/http/javadsl/server/HandlerExampleDocTest.java
|
||||
:include: handler2-java8-example-full
|
||||
|
|
@ -76,11 +77,9 @@ In Java 8 handlers can be provided as function literals or method references. Th
|
|||
if one type of a handler does not match the given values, *all* possible candidates would be printed in the error message
|
||||
(22 of them), instead of just the one arity-matching method, pointing out that the type does not match.
|
||||
|
||||
We opted for better error messages as we feel this is more helpful when developing applications,
|
||||
instead of having one overloaded method which looks nice when everything works, but procudes hard to read error
|
||||
messages if something does not match up.
|
||||
|
||||
|
||||
We opted for better error messages as we feel this is more helpful when developing applications,
|
||||
instead of having one overloaded method which looks nice when everything works, but procudes hard to read error
|
||||
messages if something does not match up.
|
||||
|
||||
Providing Handlers by Reflection
|
||||
--------------------------------
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue