Title: [740] trunk/tooling/servicemix-web/src/webapp/WEB-INF: Add a more explicit example for the web app
- Revision
- 740
- Author
- gnt
- Date
- 2005-11-03 15:00:58 -0500 (Thu, 03 Nov 2005)
Log Message
Add a more explicit example for the web app
Modified Paths
Diff
Modified: trunk/components/base/src/main/java/org/servicemix/components/http/HttpMarshaler.java (739 => 740)
--- trunk/components/base/src/main/java/org/servicemix/components/http/HttpMarshaler.java 2005-11-03 19:23:34 UTC (rev 739)
+++ trunk/components/base/src/main/java/org/servicemix/components/http/HttpMarshaler.java 2005-11-03 20:00:58 UTC (rev 740)
@@ -46,7 +46,7 @@
private String contentType = "text/xml";
public void toNMS(MessageExchange exchange, NormalizedMessage inMessage, HttpServletRequest request) throws IOException, MessagingException {
- addNmsProperties(inMessage, request);
+ addNmsProperties(exchange, inMessage, request);
String method = request.getMethod();
if (method != null && method.equalsIgnoreCase("POST")) {
inMessage.setContent(new StreamSource(request.getInputStream()));
@@ -77,15 +77,21 @@
// Implementation methods
// -------------------------------------------------------------------------
- protected void addNmsProperties(NormalizedMessage message, HttpServletRequest request) {
+ protected void addNmsProperties(MessageExchange exchange, NormalizedMessage message, HttpServletRequest request) {
Enumeration enumeration = request.getHeaderNames();
while (enumeration.hasMoreElements()) {
String name = (String) enumeration.nextElement();
String value = request.getHeader(name);
+ exchange.setProperty(name, value);
+ }
+ enumeration = request.getParameterNames();
+ while (enumeration.hasMoreElements()) {
+ String name = (String) enumeration.nextElement();
+ String value = request.getParameter(name);
message.setProperty(name, value);
}
}
-
+
protected void addHttpHeaders(HttpServletResponse response, NormalizedMessage normalizedMessage) {
for (Iterator iter = normalizedMessage.getPropertyNames().iterator(); iter.hasNext();) {
String name = (String) iter.next();
Modified: trunk/tooling/servicemix-web/src/webapp/WEB-INF/applicationContext.xml (739 => 740)
--- trunk/tooling/servicemix-web/src/webapp/WEB-INF/applicationContext.xml 2005-11-03 19:23:34 UTC (rev 739)
+++ trunk/tooling/servicemix-web/src/webapp/WEB-INF/applicationContext.xml 2005-11-03 20:00:58 UTC (rev 740)
@@ -28,7 +28,11 @@
<!-- a simple Echo service to test InOut message exchanges using HTTP-->
<sm:activationSpec componentName="echo" service="foo:echo" >
- <sm:component><bean class="org.servicemix.components.util.EchoComponent" /></sm:component>
+ <sm:component>
+ <bean class="org.servicemix.components.HelloWorldComponent">
+ <property name="property" value="name"/>
+ </bean>
+ </sm:component>
</sm:activationSpec>
<!-- lets kick off a timer to send messages on an input destination topic -->
Modified: trunk/tooling/servicemix-web/src/webapp/examples/index.html (739 => 740)
--- trunk/tooling/servicemix-web/src/webapp/examples/index.html 2005-11-03 19:23:34 UTC (rev 739)
+++ trunk/tooling/servicemix-web/src/webapp/examples/index.html 2005-11-03 20:00:58 UTC (rev 740)
@@ -10,9 +10,11 @@
<p>Welcome to the web examples for ServiceMix</p>
-<ul>
-<li><a href="" a GET</a> into the HTTP binding</li>
-</ul>
+Perform a GET into the HTTP binding <p>
+<form method="get" action=""
+ <input type="text" name="name" value="James">
+ <input type="submit" value="Submit">
+</form>
</body>
</html>