taglib prefix="s"

来源:互联网 发布:mysql 图片 编辑:程序博客网 时间:2024/05/22 00:06

<s:formaction="actionname">

 

</s:form>

表示交由actionnameaction来处理请求。

参数只要和actiongname里面的属性名字一样就可以传递过去

例如下面actionname中的lo.username就可以接收到username的值

<tdalign="center">

       <spanclass="zi">用户名:</span>

       <s:textfieldid="username"name="lo.username"size="13"/>

</td>

 

 

下面的例子用来在页面上获得forums列表,中间的连接可以在forumname处形成一个链接。把id传递给BBS_TOPIC_LIST中的id

<s:propertyvalue="topicCount"/>这句话可以获得forums中的topicCount

 

<s:iteratorvalue="forums">

              <tralign="center">

                  <tdwidth="25%">

                     <A href="<s:urlaction="user/BBS_TOPIC_LIST">

<s:paramname="id"value="id"/>

</s:url>" >

 <s:propertyvalue="forumname"/> </A>

                  </td>

                  <tdwidth="10%"align="center">

                     <s:propertyvalue="topicCount"/>

                  </td>

              </tr>

</s:iterator>

 

上面的页面点击版块名字可以跳转到具体的版块。在版块页中s:property可以直接获得BBS_TOPIC_LIST中的属性。

<tdheight="21"colspan="2"align="center"class="zczi">

       <s:propertyvalue="tview.author"/>

</td>

原创粉丝点击