Hello World

    WEB applications can be developed using XWorker. The video below demonstrates the process from creating a model project, setting up the server, and writing and running a HelloWorld page.

Create WEB project

     Use the command dml --project --web, or dml.sh --project --web under Linux.

WebServer.dml

<?xml version='1.0' encoding='utf-8'?>

<JettyServer name="WebServer" descriptors="xworker.jetty.JettyServer">
     <Handlers>
         <WebAppContext name="WebAppContext" contextPath="/" resourceBase="."/>
     </Handlers>
</JettyServer>

HelloWorld.dml

<?xml version='1.0' encoding='utf-8'?>

<SimpleControl name="HelloWorld" descriptors="xworker.web.controls.SimpleControl">
     <view>
         <code name="code" code="&lt;h1>Hello world&lt;/h1>"/>
     </view>
     <result name="success" value="HelloWorld/@view"/>
</SimpleControl>

 

Copyright ©  2007-2019 XWorker.org  版权所有  沪ICP备08000575号