|
| <prev next> |
Re: XMLC 2.2 Alpha 2 and Examples released (Download location): msg#00000java.enhydra.xmlc
Here are some more modifications including adding Tomcat's web.xml from Tomcat-4.1.12 to the res/conf directory. This makes it so that the app's web.xml file doesn't need to reference platform specific servlets (like Tomcat's default servlet). I also cleaned up the build file, added some compiler properties to the build.properties file, and modified the server.xml to point to ports that are less likely to be in use by another version of Tomcat running on the same machine. Now you access the servlet via: http://localhost:8081/xmlc/ BTW, why are all the parameters for org.enhydra.xml.xmlc.servlet.XMLCContext provided via <context-param>'s rather than servlet params specifically for XMLCContext? Why do they need to be global to the webapp? Also, is it possible to provide the reloading via a URL or InputStream instead of using File IO? File IO in webapps is *not* portable. If you deploy the webapp via a .war file and not out of a directory on the filesystem, there is no file IO possible except for some path outside the webapp (if access has been provided by the host file system) or in the server's tempdir (defined by the servlet spec). Either way, it would be nice to be able to specify a directory for source files relative to the current webapp instead of a fully qualified hardcoded path. If it were File IO, they could be loaded via context.getRealPath("/path/within/webapp"). I guess I haven't looked at the XMLCContext source yet. I'll do that tomorrow. Jake At 05:50 AM 12/1/2002 -0600, you wrote: Here are some slight modifications to the example app make things work for both Unix and Windows users out of the box (attached zip file). I've included only the files that were modified. Should be obvious where they go.http://homepage.mac.com/taweili/XMLC.html David On Thursday, Nov 28, 2002, at 01:31 Asia/Shanghai, David Li wrote: The release fixes several bugs and updates several helpers classes to ease the integration of XMLC in a servlet containers. This new release contains an example webapp using the new reloading for XMLC which can be easily deploy under Tomcat containers. (nothing Tomcat specific about it but I just have time to test it on Tomcat.) The attached is the README for the example. David --- This is an example program to demo how to use XMLC in a Servlet. The example is use Tomcat 4.1.12, other containers have not been tested. Configuration: Copy the 'build.properties.examples' to 'build.properties' and edit the two properties according to your local setup. Build: Simply 'ant' Running: A script run-tomcat.sh will be created in this directory. Just type $ ./run-tomcat.sh Accessing the demo: The demo servlet is located at /xmlc/ReloadTest and can be access with http://localhost:8080/xmlc/ReloadTest The servlet expects a 'docClass' or a 'doc' parameter pointing to the document to be retrived. The 'docClass' parameter points to a fully qualified classname of a XMLC compiled page. Currently available document class are: Compiled from res/pkg, xmlc.demo.test01HTML xmlc.demo.test02HTML Compiled from res/page xmlc.page.page01HTML xmlc.page.page02HTML Example: http://localhost:8080/xmlc/ReloadTest?docClass=xmlc.page.page02HTML The 'doc' parameter points to a relative path name of a page to be compiled and retrieved. These pages do not have to be precompiled by XMLC in order to be loaded and use as a XMLObject. Currently available documents are: dyna/dyna01.html dyna/dyna02.html The following pages are the source of the above compiled XMLC class. They can be loaded with the following path name. However, loading them will only return a XMLObject, not the above named class/interface. page/page01.html page/page02.html pkg/xmlc/demo/test01.html pkg/xmlc/demo/test02.html Examples: http://localhost:8080/xmlc/ReloadTest?doc=dyna/dyna01.html ReloadTest source: The source code for ReloadTest servlet is located under src/xmlc/demo/ReloadTest.java. This file demostracted the use of the following class: org.enhydra.xml.xmlc.servlet.XMLCContext: This is a convenient class to integrate XMLC with Servlet. It configure the XMLCFactory with parameter from Servlet context. In this demo, the configuration is done in res/webapps/xmlc/WEB-INF/web.xml for the XMLC WebApp. The document on the parameters can be found in the javadoc of org.enhydra.xml.xmlc.servlet.XMLCContext. This class also provides methods to serialize of XMLObject object to the response with various of configuration. org.enhydra.xml.xmlc.deferredparsing.XMLCDeferredParsingFactory: The dynamic page loading using method the createFromFile which is specific to this call and not in XMLCFactory. The use of this method is demo here. _______________________________________________ XMLC mailing list XMLC@xxxxxxxxxxx http://www.enhydra.org/mailman/listinfo.cgi/xmlc _______________________________________________ XMLC mailing list XMLC@xxxxxxxxxxx http://www.enhydra.org/mailman/listinfo.cgi/xmlc </blockquote></x-html>
|
|
| <Prev in Thread] | Current Thread | [Next in Thread> |
|---|---|---|
| Next by Date: | Re: XMLC 2.2 Alpha 2 and Examples released (Download location), David Li |
|---|---|
| Next by Thread: | Re: XMLC 2.2 Alpha 2 and Examples released (Download location), David Li |
| Indexes: | [Date] [Thread] [Top] [All Lists] |
| News | FAQ | advertise |