ule子/码头设置 [英] Mule/Jetty Setup

查看:111
本文介绍了ule子/码头设置的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一个正常工作的Mule应用程序,我想将Jetty设置为响应http请求.以下配置:

I have a working Mule application that I want to setup Jetty on to respond to http requests. The following config:

<jetty:endpoint address="http://localhost:8080" 
                name="jettyEndpoint" 
                host="localhost" 
                port="8080" path="/" 
                synchronous="true" /> 

<service name="jettyUMO">
  <inbound>
    <jetty:inbound-endpoint ref="jettyEndpoint" /> 
  </inbound>
  <test:component appendString="Received" /> 
</service>

...在启动应用程序时有效,并将选择的浏览器指向 http://localhost:8080 -根据test:component,显示的全部为已接收".

...works when I start the application, and point browser of choice to http://localhost:8080 - all that gets displayed is "Received", per the test:component.

我想要做的就是更新此文件,以便我不希望看到已接收",而是要转到定义index.html文件的位置.我的假设是我必须将test:component更改为出站端点-这是正确的吗?我在哪里指定路径(相对或绝对)?

What I want to do is update this so that instead of seeing "Received", I want to go to where I defined an index.html file. My assumption is that I have to change the test:component out for an outbound endpoint - is this correct? Where would I specify the path (relative or absolute)?

推荐答案

我必须添加一个jetty:connector实例:

I had to add a jetty:connector instance:

<jetty:connector name="httpConnector" 
                 configFile="conf/jettyConfig.xml" 
                 useContinuations="true" />

这是jettyConfig.xml的内容,因为

Here's the contents of the jettyConfig.xml because the simple example has errors:

<?xml version="1.0"?>
<!DOCTYPE Configure PUBLIC "-//Mort Bay Consulting//DTD Configure//EN" "http://jetty.mortbay.org/configure.dtd">

<Configure id="Server" class="org.mortbay.jetty.Server">
  <Call name="addConnector">
    <Arg>
      <New class="org.mortbay.jetty.nio.SelectChannelConnector">
        <Set name="port">8080</Set>
      </New>
    </Arg>
  </Call>

  <Set name="handler">
    <New id="Handlers" class="org.mortbay.jetty.handler.HandlerCollection">
      <Set name="handlers">
        <Array type="org.mortbay.jetty.Handler">
          <Item>
            <New id="Contexts" class="org.mortbay.jetty.handler.ContextHandlerCollection"/>
          </Item>
          <Item>
            <New id="DefaultHandler" class="org.mortbay.jetty.handler.DefaultHandler"/>
          </Item>
        </Array>
      </Set>
    </New>
  </Set>

  <Call name="addLifeCycle">
    <Arg>
      <New class="org.mortbay.jetty.deployer.WebAppDeployer">
        <Set name="contexts"><Ref id="Contexts"/></Set>
        <Set name="webAppDir">path/webapps</Set>
      </New>
    </Arg>
  </Call>
</Configure>

这篇关于ule子/码头设置的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆