The demo has three goals:
- To demonstrate the simplicity of archive deployment with PageBox architecture
- To provide a way to check your archive in a validation environment (Solaris, Tomcat 3.2).
- To present Cocoon and SOAP support.
You need to have an archive to publish. This archive can be either a .war or a .jar.
- If it is a .war, it must have the same organization as described in Servlet specification.
However JSPservlet doesn’t read web.xml. So it provides no support for servlet name mapping.
- For .jar archive, please refer to examples in step section below.
This archive can includes resources such as serialized data, images and html pages, Servlets and compiled JSPs.
To compile your JSPs for the demo, you must use Tomcat precompiler.
To test your archive before publish it, I recommend you to download Tomcat 3.2.1 from
- Install JDK 1.3 if needed. You can download it from http://java.sun.com/j2se
- Download PublisherClient from here
- Include PublisherClient archive on your CLASSPATH
Check if JSPservletDemo is subscribing. Go to JSPservletDemo/publish.
- Starts PublisherClient with java PublisherClient/PublisherClient. You should get that display:
The location where to publish the archive is already set.
- Select the archive. A file chooser is displayed:
Once you have selected your archive, click on publish button.
- The screen is updated:
- You can check publication on server side with this URL:
You should get a display like this:
- You can also check the current subscription/publication status that should have been updated.
- For demo purpose your archive has been published on the same location as it was published.
So you can check your archive is published with
You should something like:
You can also look at the log with
and at the stats with
- You can look at repository status with JSPservletDemo/archiveList.
- Suppose your archive is a jar named myArchive containing a servlet myPath/myServlet.class,
you can invoke it with
You can also include images and html files in your archive.
In this case, you must reference them with the proper extension,
for instance if you included myPath/myPage.html in your jar archive,
you can reference it as
Cocoon and SOAP demo
We deployed on this site the environment presented on Cocoon/SOAP support
Its main figure is
So support archives on the diagram are Cocoon and SOAP plus their prerequisites.
To simplify the demo, we included SOAP server support.
Therefore the demo acts both as a presentation and a set of web services.
We deployed two archives:
- demo to illustrate the use of network processors and web services
- samples - a copy of Cocoon 1.8.2 samples to illustrate publishing capabilities of Cocoon
You should get this form:
Query is whatever you want. It is a string sent to the web service.
Url is the web service URL, http://www.pagebox.net/JSPservletDemo/loopbackHTTP to invoke the embedded loopback server.
After you clicked on submit, you should get this:
What happend behind the curtain?
- first.htm is an HTML page stored as a resource in demo archive.
When you clicked on submit, you made a request to demo.xml.
- As demo.xml had an XML suffix Cocoon was invoked to process it.
- Cocoon found that demo.xml was an XSP file - a sort of XML JSP.
Cocoon compiled this demo.xml on the fly if needed and ran it.
- demo.xml produced an XML message using request parameters. Here as you selected HTTP protocol,
demo.xml added a Processing instruction to the XML message indicating HTTP network processor should be used.
- Then Cocoon called the HTTP network processor with the XML message.
- The network processor processed the message and sent it to the loopback server.
- The network processor processed the loopback server response and merged it with the request.
Then it added a Processing instruction to tell Cocoon to process the message next with the XML formatter.
- The formatter returned the XML message to the browser.
Let's go back to the first.htm form.
Now select SOAP on the list.
Url is the SOAP router URL, http://www.pagebox.net/JSPservletDemo/rpcrouter to invoke the embedded SOAP router.
You can try calling it on your browser. You should get a message:
Sorry, I don't speak via HTTP GET
you have to use HTTP POST to talk to me.
You shouldn't get this:
What happend when you get that message?
You shouldn't get this error because we deployed the SOAP service with this command:
The message contains an Error element with the rpcrouter message.
The SOAP loopback service is not registered.
http://www.pagebox.net/JSPservletDemo/rpcrouter deploy DeploymentDescriptor.xml
DeploymentDescriptor.xml was defined like this:
Here is what you should get:
You should get this form:
You should be able to call the examples on the list but you cannot view the XSP and stylesheet files.
The reason is that the component responsible to display files assumes XML and XSL to be stored in files and not in archives
as it is the case with PageBox. We could patch the component to support archives but we didn't so far.
- We limited the archive size to 192 KB. If your archive is bigger, the upload will fail.
It should however be enough to test the functionality.
- The response time is bad at the first request,
especially for the first SOAP request and when an XSP file must be compiled.
Then on this site you can expect a service time around or below 200ms for demo.
We get the same performance with a 700Mhz laptop.
It is close to Cocoon-alone performance.
©2001-2004 Alexis Grandemange