@@ -63,6 +63,8 @@ Ivy and other dependency managers can be used as well.
63
63
Configuration
64
64
-------------
65
65
66
+ ## Servlet
67
+
66
68
Here's an example excerpt of a web.xml file to communicate to a Solr server:
67
69
68
70
<servlet>
@@ -106,11 +108,15 @@ them from the normal query parameters in case of a conflict.:
106
108
<url-pattern>/mywebapp/cluster/*</url-pattern>
107
109
</servlet-mapping>
108
110
111
+ ## SpringMVC
112
+
109
113
If you are using ** SpringMVC** , then an alternative is to use its
110
114
[ ServletWrappingController] ( http://static.springsource.org/spring/docs/3.0.x/api/org/springframework/web/servlet/mvc/ServletWrappingController.html )
111
115
so that you can configure this servlet via Spring, which is supremely flexible, instead of having to modify your web.xml. However, note that some
112
116
customization may be needed to divide the URL at the proxied portion; see [ Issue #15 ] ( https://github.com/mitre/HTTP-Proxy-Servlet/issues/15 ) .
113
117
118
+ ## Spring Boot
119
+
114
120
If you are using ** Spring Boot** , then consider this basic configuration:
115
121
116
122
``` java
@@ -142,3 +148,41 @@ proxy:
142
148
servlet_url: /solr/*
143
149
target_url: http://solrserver:8983/solr
144
150
```
151
+
152
+
153
+ ## Dropwizard
154
+
155
+ Addition of Smiley's proxy to Dropwizard is very straightforward.
156
+
157
+ Add a new property in the Dropwizard app ` .yml ` file
158
+
159
+ ```
160
+ targetUri: http://foo.com/api
161
+ ```
162
+
163
+ Create a new configuration property
164
+
165
+ ```
166
+ @NotEmpty
167
+ private String targetUri = "";
168
+
169
+ @JsonProperty("targetUri")
170
+ public String getTargetUri() {
171
+ return targetUri;
172
+ }
173
+ ```
174
+
175
+ Then create register Smiley's proxy servlet with Jetty through the Dropwizard service's App ` run() ` method.
176
+
177
+ ```
178
+ @Override
179
+ public void run(final ShepherdServiceConfiguration configuration,
180
+ final Environment environment) {
181
+
182
+
183
+ environment.getApplicationContext()
184
+ .addServlet("org.mitre.dsmiley.httpproxy.ProxyServlet", "foo/*")
185
+ .setInitParameter("targetUri", configuration.getTargetUri());
186
+ ```
187
+
188
+
0 commit comments