File tree Expand file tree Collapse file tree 3 files changed +42
-0
lines changed
resources/org/httprpc/test Expand file tree Collapse file tree 3 files changed +42
-0
lines changed Original file line number Diff line number Diff line change 1+ /*
2+ * Licensed under the Apache License, Version 2.0 (the "License");
3+ * you may not use this file except in compliance with the License.
4+ * You may obtain a copy of the License at
5+ *
6+ * http://www.apache.org/licenses/LICENSE-2.0
7+ *
8+ * Unless required by applicable law or agreed to in writing, software
9+ * distributed under the License is distributed on an "AS IS" BASIS,
10+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
11+ * See the License for the specific language governing permissions and
12+ * limitations under the License.
13+ */
14+
15+ package org .httprpc .test ;
16+
17+ import org .httprpc .RequestMethod ;
18+ import org .httprpc .WebService ;
19+
20+ import javax .servlet .annotation .WebServlet ;
21+
22+ /**
23+ * Test service.
24+ */
25+ @ WebServlet (urlPatterns ={"/greeting/*" }, loadOnStartup =1 )
26+ public class GreetingService extends WebService {
27+ private static final long serialVersionUID = 0 ;
28+
29+ @ RequestMethod ("GET" )
30+ public String getGreeting () {
31+ return "Hello, World!" ;
32+ }
33+ }
Original file line number Diff line number Diff line change 1+ GreetingService = Greeting example service.
2+
3+ getGreeting = Returns a friendly greeting.
Original file line number Diff line number Diff line change 88<body >
99
1010<h2 >Test</h2 >
11+ <a href =" ${ pageContext. request. contextPath } /greeting?api" >Greeting (API)</a ><br />
12+ <br />
13+ <a href =" ${ pageContext. request. contextPath } /greeting" >Greeting</a ><br />
14+
15+ <hr />
16+
1117<a href =" ${ pageContext. request. contextPath } /math?api" >Math (API)</a ><br />
1218<br />
1319<a href =" ${ pageContext. request. contextPath } /math/sum?a=2&b=4" >Sum</a ><br />
You can’t perform that action at this time.
0 commit comments