File tree Expand file tree Collapse file tree 2 files changed +7
-3
lines changed
examples/src/main/java/examples
jooby/src/main/java/io/jooby/internal Expand file tree Collapse file tree 2 files changed +7
-3
lines changed Original file line number Diff line number Diff line change 1717
1818import io .jooby .annotations .GET ;
1919import io .jooby .annotations .Path ;
20+ import io .jooby .annotations .PathParam ;
21+
22+ import java .util .Optional ;
2023
2124public class PlainText {
2225 @ GET
2326 @ Path ("/plaintext" )
24- public String plainText () {
25- return "Hello, World!" ;
27+ public String plainText (@ PathParam Optional < String > message ) {
28+ return message . orElse ( "Hello, World!" ) ;
2629 }
2730}
Original file line number Diff line number Diff line change @@ -622,7 +622,7 @@ private String[] path(Method m) {
622622 String [] root = mvcAnnotations .pathPattern (m .getDeclaringClass ());
623623 if (root == null ) {
624624 if (path == null ) {
625- return new String [] {"/" };
625+ return new String []{"/" };
626626 }
627627 return path ;
628628 }
@@ -631,6 +631,7 @@ private String[] path(Method m) {
631631 }
632632 String [] result = new String [root .length * path .length ];
633633 int k = 0 ;
634+
634635 for (String base : root ) {
635636 for (String element : path ) {
636637 result [k ] = base + "/" + element ;
You can’t perform that action at this time.
0 commit comments