struts2 中有些标签并不好用,默认加了好多 tr,td 的感觉很不好,
  
  <s:label name="checkname" theme="bbscs0"/>
   label.ftl

struts 2 自定义模板<#--
struts 2 自定义模板
/*
struts 2 自定义模板 * $Id: Action.java 502296 2007-02-01 17:33:39Z niallp $
struts 2 自定义模板 *
struts 2 自定义模板 * Licensed to the Apache Software Foundation (ASF) under one
struts 2 自定义模板 * or more contributor license agreements.  See the NOTICE file
struts 2 自定义模板 * distributed with this work for additional information
struts 2 自定义模板 * regarding copyright ownership.  The ASF licenses this file
struts 2 自定义模板 * to you under the Apache License, Version 2.0 (the
struts 2 自定义模板 * "License"); you may not use this file except in compliance
struts 2 自定义模板 * with the License.  You may obtain a copy of the License at
struts 2 自定义模板 *
struts 2 自定义模板 *  http://www.apache.org/licenses/LICENSE-2.0
struts 2 自定义模板 *
struts 2 自定义模板 * Unless required by applicable law or agreed to in writing,
struts 2 自定义模板 * software distributed under the License is distributed on an
struts 2 自定义模板 * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
struts 2 自定义模板 * KIND, either express or implied.  See the License for the
struts 2 自定义模板 * specific language governing permissions and limitations
struts 2 自定义模板 * under the License.
struts 2 自定义模板 */
struts 2 自定义模板--
>
struts 2 自定义模板
<#--
struts 2 自定义模板    
Only show message if errors are available.
struts 2 自定义模板    This will be done if ActionSupport is used.
struts 2 自定义模板--
>
struts 2 自定义模板
<#assign hasFieldErrors = parameters.name?exists && fieldErrors?exists && fieldErrors[parameters.name]?exists/> 
struts 2 自定义模板
struts 2 自定义模板    
struts 2 自定义模板
<#if hasFieldErrors>
struts 2 自定义模板
struts 2 自定义模板
<#list fieldErrors[parameters.name] as error>
struts 2 自定义模板    
<div<#rt/>
struts 2 自定义模板    
<#if parameters.id?exists>
struts 2 自定义模板     errorFor="${parameters.id}"
<#rt/>
struts 2 自定义模板    
</#if>
struts 2 自定义模板    class="errorMessage">
struts 2 自定义模板             ${error?html}
struts 2 自定义模板    
</div><#t/>
struts 2 自定义模板
</#list>
struts 2 自定义模板
<#t/>
struts 2 自定义模板
</#if>
struts 2 自定义模板
struts 2 自定义模板
<#if parameters.label?exists>
struts 2 自定义模板
<#if parameters.labelposition?default("top") == 'top'>
struts 2 自定义模板
<div <#rt/>
struts 2 自定义模板
<#else>
struts 2 自定义模板
<span <#rt/>
struts 2 自定义模板
</#if>
struts 2 自定义模板
<#if parameters.id?exists>>
actionerror.ftl
struts 2 自定义模板<#if (actionErrors?exists && actionErrors?size > 0)> 
struts 2 自定义模板
<div class="errormsg"> 
struts 2 自定义模板
<#list actionErrors as error> 
struts 2 自定义模板
<span class="errorMessage">${error}</span><br/> 
struts 2 自定义模板
</#list> 
struts 2 自定义模板
</div> 
struts 2 自定义模板
</#if> 

struts 2 自定义模板

相关文章:

  • 2021-07-09
  • 2021-08-05
  • 2021-11-13
  • 2021-10-16
  • 2021-06-28
  • 2021-12-19
  • 2022-03-06
猜你喜欢
  • 2021-11-27
  • 2021-07-14
  • 2021-12-29
  • 2021-07-23
  • 2021-09-02
  • 2021-12-08
相关资源
相似解决方案