In multiple instances I've run into an annoying limitation of our
embedded Tomcat and Jetty support... We cannot serve Web content, HTML
pages, scripts etc. when we run Tomcat or Jetty embedded in a J2SE
program. This makes it more difficult than it should be to test SCA
applications that use our JSON-RPC binding in particular, as you need to
package these applications in WARs, deploy them to a standalone Tomcat
or Jetty, use remote debugging to step through them etc... as opposed to
simply running them from a J2SE program's main()...
I'd like to leverage a small variation of our Crud/resource
implementation type sample to fix that, and simply use a component to
serve web content out of a directory inside an application.
Here's how the helloworld-jsonrpc sample composite will look with that
component implementation (see the BEGIN/END new-stuff section):
<composite xmlns="http://www.osoa.org/xmlns/sca/1.0"
targetNamespace="http://sample"
xmlns:sample="http://sample"
name="helloworldjsonrpc">
<component name="HelloWorldJSONServiceComponent">
<service name="HelloWorldService">
<interface.java
interface="helloworldjsonrpc.HelloWorldService"/>
<binding.jsonrpc/>
</service>
<implementation.java
class="helloworldjsonrpc.HelloWorldServiceImpl"/>
</component>
<!-- BEGIN new stuff -->
<component name="MyHelloWorldContent">
<implementation.webResource location="location of the HTML and
JS files inside the contribution"/>
</component>
<!-- END new stuff -->
</composite>
With that simple change, we will be able to run directly from J2SE and
serve Web content out of the configured directory... so we won't have to
always package the whole app in a WAR and deploy it to a standalone Web
container.
Thoughts?
If there's no objection, I'd like to start adding that support later
this week.
--
Jean-Sebastien
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]