开发者

Is there something using which i can write the code in jsp, and run it as standalone program?

Is it possible to code as if you are coding for any web application [ use html, jsp, css, spring etc ], but on execution it should not require any container or any server. It should run as if we are running a swing application.

Somebody told me that Adobe Flex is just what i am asking for. 开发者_开发百科Is it so?


You are looking for Adobe AIR. It lets you define the user interface using a markup language called MXML and compiles it in to a desktop application that is platform independent. Though AIR uses the Flex framework, it has additional classes that allows you to interact with the desktop environment (file handling, window management etc).

AIR is platform independent - you can run an AIR application on any platform that has AIR environment installed in it (just like you need to install java to run a java app).

Here is a sample AIR code.

<?xml version="1.0" encoding="utf-8"?>
<mx:WindowedApplication xmlns:mx="http://www.adobe.com/2006/mxml"
    title="App Title" width="400" height="200" 
    creationComplete="someFunction()">
    <mx:TextInput id="ti"/>
    <mx:Button id="btn" label="Click Me!" click="onClick();"/>
    <mx:Script>
        <![CDATA[
            private function someFunction():void
            {
                ti.text = "Application created!";
                //do initialization stuff here
            }
            private function onClick():void
            {
                ti.text = "You clicked me!"
            }
        ]]>
    </mx:Script>
</mx:WindowedApplication>
0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜