论坛首页 Java企业应用论坛

关于一个新的web框架Wicket,看看它与echo和tapestry...

浏览 8860 次
精华帖 (0) :: 良好帖 (0) :: 新手帖 (0) :: 隐藏帖 (0)
作者 正文
   发表时间:2004-10-13  
大家来关注一个全新的web框架Wicket,它也是一个面向对象的web框架,它没有echo和tapestry成熟,看看它与echo和tapestry的区别??
我看了一下Wicket,好像比tapestry容易用
http://www.theserverside.com/news/thread.tss?thread_id=28162
   发表时间:2004-10-13  
稍微看了一下,有点意思,有空研究研究
0 请登录后投票
   发表时间:2004-10-13  
关注,看起来不错.
0 请登录后投票
   发表时间:2004-10-14  
这个Wicket框架现在还是alpha版,还不是很成熟,但是国外的开发人员对此框架评价很高,甚至超过Tapestry和Echo(它与Echo非常相似),容易上手,以后有大的发展前景,大家来关注一下,我时觉得Tapestry上手比较难,对于我们开发人员来说就是简单实用,并且容易与其他的框架如hibernate结合,这是最好的,我看了一下它的测试代码还是比较简单的,我比较喜欢
0 请登录后投票
   发表时间:2004-10-14  
大概看了一下,感觉不错,比Tapestry容易
0 请登录后投票
   发表时间:2004-10-14  
Echo和Wicket比较容易上手的,Wicket不需要xml配置文件,如:Wicket的HelloWord例子:
HelloWorld.html:
<html>
<body>

<span componentName = "message"/>

</body>
</html>
HelloWorld.java:
package helloworld;

import com.voicetribe.wicket.PageParameters;
import com.voicetribe.wicket.markup.html.HtmlPage;
import com.voicetribe.wicket.markup.html.basic.Label;

/**
* Everybody's favorite example.
* @author Jonathan Locke
*/
public class HelloWorld extends HtmlPage
{
/**
* Constructor
* @param parameters Page parameters
*/
public HelloWorld(final PageParameters parameters)
{
add(new Label("message", "Hello world!"));
}
}
HelloWorldApplication.java:
package helloworld;

import com.voicetribe.wicket.WebApplication;

/**
* HttpApplication class for hello world example.
* @author Jonathan Locke
*/
public class HelloWorldApplication extends WebApplication
{
/**
* Constructor.
*/
public HelloWorldApplication()
{
getSettings().setHomePage(HelloWorld.class);
}
}
Wicket不需要xml配置文件,只需要在web.xml加上:
<servlet>
<servlet-name>HelloWorld</servlet-name>
<servlet-class>helloworld.HelloWorldApplication</servlet-class>
<load-on-startup>1</load-on-startup>
</servlet>
就可以了,简单吧!
0 请登录后投票
   发表时间:2004-10-15  
没有看出它比 Echo/EchoPoint 好在哪里。
它的这种做法,只是 EchoPoint 的 HtmlTemplate 就可以支持了。
除此之外,还有 JspTemplate,还有很多其他组件。
最简单的 Echo 比你的这段代码还简单。

http://www.nextapp.com/products/echo/doc/tutorial/hello_world.html

import nextapp.echo.ContentPane;
import nextapp.echo.EchoInstance;
import nextapp.echo.Label;
import nextapp.echo.Window;
import nextapp.echoservlet.EchoServer;

public class HelloWorldServlet extends EchoServer {

    // Returns a new user-instance of the Echo application.
    public EchoInstance newInstance(); {
        return new HelloWorld();;
    }
}

class HelloWorld extends EchoInstance {

    // This init method is called when a user first visits the 
    // application.  It must return a Window object that will 
    // occupy the contents of the user's open browser window.
    public Window init(); {
    
        // Create a new window.
        Window window = new Window();;
        
        // Create a content pane.  Components may not be added 
        // directly to a window, only to a content pane.
        ContentPane content = new ContentPane();;
        
        // Set the window's content to be the content pane.
        window.setContent(content);;

        // Create a new label that says "Hello, World!"
        Label label = new Label("Hello, World!");;
        
        // Add the label to the content pane.
        content.add(label);;
        
        // Return the new window.
        return window;
    }
}
0 请登录后投票
   发表时间:2004-10-15  
它也是出来不久的产品,与Echo非常相似
0 请登录后投票
   发表时间:2004-10-15  
看来Wicket和Echo都是把动态内容写到Java里头么,也就是说如果想改内容必须重新编译Java类.
Tapestry现在有了groovy的支持,可以直接更改动态内容,另外Tapestry甚至可以支持重载TemplateLoader,把模版放到数据库去,支持更加复杂的应用.
  Tapestry目前有一堆控件,不知Wicket和Echo的控件丰不丰富
0 请登录后投票
   发表时间:2004-10-18  
EchoPoint 的控件非常丰富,而且不用去处理 JavaScript,
用起来还是比较爽的。
0 请登录后投票
论坛首页 Java企业应用版

跳转论坛:
Global site tag (gtag.js) - Google Analytics