About SEPPIA

xiaoxiao2021-03-06  47

The JARS directory in the module directory stores Java implementation and related class libraries. The JavaScripts directory is obviously one .js file, which calls Java implementation simple applications. Seppia's website has a more detailed documentation, which is easy to understand. I decided to transfer the test example of the "RSS News extraction" of the two days to SEPPIA. The steps are as follows: 1) Download SEPPIA 1.0.zip from Sourceforge, extract to the installation directory. 2) Create a Test.rss directory in the modules directory, which is my test module. 3) Create a jars directory in the module directory, copy the RSSLIB4J-0.2.jar file to this directory. 4) Create a JavaScripts directory in the module directory, create two script files for Fetcher.js and Main.js. The code is as follows: fetcher.js

Var URL = java.net.URL;

Var system = java.lang.system;

Var rsschannel = package.rg.gnu.stealthp.rslib.rschannel;

Var rsshandler = packages.org.gnu.stealthp.rsslib.rshandler;

Var rsSitem = packages.org.gnu.stealthp.rslib.rssitem;

Var rssparser = packages.rg.gnu.stealthp.rsslib.rsparser;

Function main () {var obj = new object (); obj.Fetch = fetch; return obj;}

Function fetch (URL) {var handler = new {var handler.parsexmlfile (new url (url), handler, true); var channel = handler.getrsSchannel (); system.out.println (channel.tostring ()) VAR items = handler.getrsSchannel (). GetItems (); for (var i = 0; i

Function main () {

Var fetcher = run ("test.rs", "fetcher");

Fetcher.Fetch ("

http://news.baidu.com/n?cmd=4&class=ingernews&pn=1&tn=rss ");

}

5) Modify the modules / org.seppia.bootstrap / javascripts / startup.js file, the content is modified to:

Function main () {

Run ("Test.RSS", "Main");

}

6) Perform java -cp. Startup under the installation directory.

The transplant is very successful, from the code that COPY in Java, I only modified a few, mainly the class will be used in the JS file header declaration, and modify for for (int i = 0 ...) to for (VAR) i = 0 ...), remove the above, the code of the FETCH method is almost exactly the same as Java. However, SEPPIA is still very improved, such as the fifth step to modify the Startup.js file is a bit cumbersome, such as a built-in module, or providing SH and BAT's script to start the application.

After the test above, I ask yourself, SEPPIA does it make sense to work in the future and develop? The answer is not known. Because I haven't encountered a very patient customer who is willing to pay for the rapid prototype development, I have mainly engaged in Web development. If SEPPIA can apply JavaScript to the web, I may be more excitement.

SEPPIA is really delicious, exquisite to source code is only 11k, and the spirit of lorenzo shared makes me admire. Anyway, SEPPIA gave me a prompt: one project can be so simple.

转载请注明原文地址:https://www.9cbs.com/read-59268.html

New Post(0)