论坛首页 Java企业应用论坛

最新WebWork教程

浏览 117044 次
该帖已经被评为精华帖
作者 正文
   发表时间:2004-06-30  
我使用Struts做过一些项目,最近看了一些WebWork的代码,发现比Struts结构简单、功能类似。学过Struts再学习WebWork很快就可以理解、使用。
0 请登录后投票
   发表时间:2004-07-05  
看来支持WebWork2的真不少啊,那也加我一个吧!
不过 感觉 webwork2 的文档资料还是不够啊
没有 struts 的多,当然对比过后,觉得却是webwork2 优秀于 struts
0 请登录后投票
   发表时间:2004-07-05  
楼主的文章暂时不能下来(Blogdriver好象在升级),还没有拜读,我也是个Webwork追随者,我第一次使用Web MVC框架就用的是webwork1,所以Struts虽然都快炒焦了,不过看过其蹩足的formBean我还是喜欢Webwork。我目前也在我的Blog(http://swallor.blogdriver.com)抽时间写点WW2的学习笔记,希望能与大家交流。
0 请登录后投票
   发表时间:2004-07-07  
如何链接地址下载有问题,请Email To:achqian@hotmail.com,我会将WebWork最新教程做为附件给你发过去。
0 请登录后投票
   发表时间:2004-07-07  
为何webwork自带的例子在eclipse中编译通不过,报的都是tag不符合tld规定的错,但是直接把war文件拷到tomcat下却可以运行。请指教,谢谢!
0 请登录后投票
   发表时间:2004-07-07  
当我在Eclipse中编译WEBWORK自带的例子webwork-example时,出现了这个错误:
<form action="<webwork:url page="hiturl.action"/>" method="GET">

报这样的错:
引用
Kind Status Priority Description Resource In Folder Location
Error unexpected page=... hiturl.jsp webwork/WebRoot/examples line 19


还有这句:
  Care to <a href="<webwork:url page="numguess.action?begin=true"/>">try again</a>?

也会报这样的错:
引用
Kind Status Priority Description Resource In Folder Location
Error unexpected page=... numguess.jsp webwork/WebRoot/examples line 10


我查了一下tld,是这样的:

<tag>
        <name>url</name>
        <tagclass>com.opensymphony.webwork.views.jsp.URLTag</tagclass>
        <bodycontent>JSP</bodycontent>
        <info>Url builds an encoded URL.</info>
        <attribute>
            <name>value</name>
            <required>false</required>
            <rtexprvalue>true</rtexprvalue>
        </attribute>
        <attribute>
            <name>id</name>
            <required>false</required>
            <rtexprvalue>true</rtexprvalue>
        </attribute>
        <attribute>
            <name>includeParams</name>
            <required>false</required>
            <rtexprvalue>true</rtexprvalue>
        </attribute>
        <attribute>
            <name>includeContext</name>
            <required>false</required>
            <rtexprvalue>false</rtexprvalue>
        </attribute>
        <attribute>
            <name>encode</name>
            <required>false</required>
            <rtexprvalue>false</rtexprvalue>
        </attribute>
    </tag>


的确没有page这个属性,可是该改成哪个属性呢,为什么WEBWORK自带的例子中会有这样的错误呢。
0 请登录后投票
   发表时间:2004-07-07  
还有这个tag:

<webwork:property value="cd" id="cd">


id这个属性也是错的。tld中是这样的

<tag>
        <name>property</name>
        <tagclass>com.opensymphony.webwork.views.jsp.PropertyTag</tagclass>
        <bodycontent>empty</bodycontent>
        <info>
            Used to get the value of a result attribute.
            If the value isn't given, the top of the stack will
            be returned.
        </info>
        <attribute>
            <name>value</name>
            <required>false</required>
            <rtexprvalue>true</rtexprvalue>
        </attribute>
        <attribute>
            <name>default</name>
            <required>false</required>
            <rtexprvalue>true</rtexprvalue>
        </attribute>
        <attribute>
            <name>escape</name>
            <required>false</required>
            <rtexprvalue>true</rtexprvalue>
        </attribute>
    </tag>


可是这回id换成什么呢?
哪位知道请知道一下,先谢了!
0 请登录后投票
   发表时间:2004-07-07  
有可能是由于example没有及时更新的缘故,所以会出现这些错误,你可以从CVS上check out最新的版本看看是否还有这个错误,然后在mail list上反馈这个信息。

最新的tag的说明可以在这里找到:
http://wiki.opensymphony.com/display/WW/Non-UI+Tags
0 请登录后投票
   发表时间:2004-07-08  
估计是你下载的WebWork版本有问题,最新的WebWork2.1可以从下面地址下载:
https://webwork.dev.java.net/files/documents/693/5330/webwork-2.1.zip
我看了它的文档,url标签根本就没有“page”这个属性。

<ww:url />

Url builds an encoded URL. If you do not include a value, then the tag will point to the current page.

attribute  required description 

value no This attribute is used to pass data to the tag. 

includeContext  no Determines whether the context path should be prepended to absolute urls or not. Default is true  

encode  no Determines if the contents should be escaped appropriately for valid HTML characters  

includeParams  no The includeParams attribute may have the value 'none' (no params);, 'get'(only GET params); or 'all'(GET and POST params);. It is used when the url tag is used without a value or page attribute. Its value is looked up on the ValueStack. If no includeParams is specified then 'get' is used. 

In this example, the form action value will be an url hiturl.action that is encoded. 

<form action="<ww:url value="'hiturl.action'"/>" method="POST">
    ...
  </form>
In this example, we are adding name/value pairs to the URL. The URL tag will build up the URL appropriately. You can also place them in the normal way with "?"; i.e., - 'hiturl.action?user=john'.

<form action="<ww:url value="'hiturl.action'">
      <ww:param name="'user'" value="'john'"/>
   </ww:url>" method="POST">
...
</form>
0 请登录后投票
   发表时间:2004-07-08  
dhj1 写道
仔细看过 webwork2 的文档. 感觉跟STRUTS1.0 相差不大.


     我想,如果你能动手做一个例子,你会发现webwork2和STRUTS1.0差别太大。现在的STRUTS比较笨重,和WEB层紧紧耦合在一起,FormBean和Action都强制要求继承它的类,严重违反了“针对接口编程”原则,视图部分只能是标签库,无任何灵活性可言。
    未来的STRUTS2.0功能类似于webwork2,但感觉似乎是遥遥无期,等STRUTS2.0出来,向下兼容估计也是一个问题(当然可以兼容,但代码的改动应该会很大)。
0 请登录后投票
论坛首页 Java企业应用版

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