`

虚拟目录和fielderror.ftl

    博客分类:
  • java
阅读更多

虚拟目录:

需要重启
方式1:
<Host name="localhost"  appBase="webapps"
            unpackWARs="true" autoDeploy="true">
        <Valve className="org.apache.catalina.valves.AccessLogValve"        directory="logs"  
               prefix="localhost_access_log." suffix=".txt"
               pattern="%h %l %u %t &quot;%r&quot; %s %b" resolveHosts="false"/>
   
         <context  path="/new"   docBase="c:\news" />  
</Host>

  conf\Catalina\localhost\abc.xml 文件      abc为虚拟目录 映射路径
   <Context docBase="c:\news"/>            c:\news  为虚拟目录
   1.多路径aaa#bbb
   2.默认的web应用 ROOT.xml

struts标签自动功能<s:fielderror fieldName="cheNum"/>

<ul class="errorMessage">
     <li><span>您的验证码输入有误!</span></li>
</ul>




模板在
struts2-core-2.1.8.1.jar  /template.simple   fielderror.ftl  

解决
src下 template\simple   package包  fielderror.ftl  
###############
<#--
/*
 * $Id: fielderror.ftl 805635 2009-08-19 00:18:54Z musachy $
 *
 * Licensed to the Apache Software Foundation (ASF) under one
 * or more contributor license agreements.  See the NOTICE file
 * distributed with this work for additional information
 * regarding copyright ownership.  The ASF licenses this file
 * to you under the Apache License, Version 2.0 (the
 * "License"); you may not use this file except in compliance
 * with the License.  You may obtain a copy of the License at
 *
 *  http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing,
 * software distributed under the License is distributed on an
 * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
 * KIND, either express or implied.  See the License for the
 * specific language governing permissions and limitations
 * under the License.
 */
-->
<#if fieldErrors??><#t/>
<#assign eKeys = fieldErrors.keySet()><#t/>
<#assign eKeysSize = eKeys.size()><#t/>
<#assign doneStartUlTag=false><#t/>
<#assign doneEndUlTag=false><#t/>
<#assign haveMatchedErrorField=false><#t/>
<#if (fieldErrorFieldNames?size > 0) ><#t/>
    <#list fieldErrorFieldNames as fieldErrorFieldName><#t/>
        <#list eKeys as eKey><#t/>
        <#if (eKey = fieldErrorFieldName)><#t/>
            <#assign haveMatchedErrorField=true><#t/>
            <#assign eValue = fieldErrors[fieldErrorFieldName]><#t/>
            <#if (haveMatchedErrorField && (!doneStartUlTag))><#t/>
                   <#assign doneStartUlTag=true><#t/>
            </#if><#t/>
            <#list eValue as eEachValue><#t/>
                ${eEachValue}
            </#list><#t/>            
        </#if><#t/>
        </#list><#t/>
    </#list><#t/>
    <#if (haveMatchedErrorField && (!doneEndUlTag))><#t/>
        <#assign doneEndUlTag=true><#t/>
    </#if><#t/>
<#else><#t/>    
    <#if (eKeysSize > 0)><#t/>
        <ul<#rt/>
<#if parameters.cssClass??>
 class="${parameters.cssClass?html}"<#rt/>
<#else>
 class="errorMessage"<#rt/>
</#if>
<#if parameters.cssStyle??>
 style="${parameters.cssStyle?html}"<#rt/>
</#if>
>
            <#list eKeys as eKey><#t/>
                <#assign eValue = fieldErrors[eKey]><#t/>
                <#list eValue as eEachValue><#t/>
                    <li><span><#if parameters.escape>${eEachValue!?html}

<#else>${eEachValue!}</#if></span></li>
                </#list><#t/>
            </#list><#t/>
        </ul>
    </#if><#t/>
</#if><#t/>
</#if><#t/>
###############


分享到:
评论

相关推荐

    struts2 fielderror去掉样式

    NULL 博文链接:https://mzlly999.iteye.com/blog/1161501

    Struts 2 取消 fielderror 系统默认样式

    NULL 博文链接:https://978182241.iteye.com/blog/1827062

    获取 STRUTS2 FIELDERROR

    STRUTS2 s:fielderror 会给我们软件开发人员带来很多不方便。而且STRUTS2提供的样式也很难调整(需要结合STRUTS2源码以及修改样式模板配置)。本人找了许多信息GOOGLE等 都没有得到满意的内容。很多人留言说 通过...

    JSP_struts2标签大全

    18. fielderror 16 19. file 16 21. generator 17 22. head 18 23. hidden 18 24. i18n 19 25. if 19 26. include 20 27. inputtransferselect 21 28. iterator 21 29. label 22 30. optgroup 23 31. ...

    struts2 spring整合fieldError问题

    用到了校验框架,在jsp页面校验失败一次后,无论再次输入正确与否都跳转不到except page。

    Struts2多文件上传与邮件附件发送

    fielderror里面会有如下的提示: the request was rejected because its size (16272982) exceeds the configured maximum (9000000) 2.fileUpload拦截器的maximumSize属性必须小于struts.multipart.maxSize的值。...

    SPRING API 2.0.CHM

    FieldError FieldRetrievingFactoryBean FileCopyUtils FileEditor FileSystemResource FileSystemResourceLoader FileSystemXmlApplicationContext FilterDefinitionFactoryBean FixedLocaleResolver ...

    博客附件--包下载 struts2

    附件 附件 附件 moon5284 struts2.x 已经修改了fielderror的换行样式

    struts2文件上传下载

    struts2文件上传与下载, &lt;s:fielderror&gt;&lt;/s:fielderror&gt; 文件"&gt;&lt;/s:file&gt; &lt;s:submit id="submit" value="sbumit"&gt;&lt;/s:submit&gt; &lt;/s:form&gt;

    struts2 标签库 帮助文档

    1. &lt;s:fielderror&gt;&lt;/s:fielderror&gt;-----显示文件错误信息 2. &lt;s:file&gt;&lt;/s:file&gt;-----文件上传 3. &lt;s:form action=""&gt;&lt;/s:form&gt;-----获取相应form的值 G: 1. &lt;s:generator separator="" val=""&gt;&lt;/s:...

    struts2中simple主题下&lt;s:fieldError&gt;标签默认样式的移除方法

    主要给大家介绍了关于struts2中simple主题下标签默认样式的移除方法,文中通过示例代码介绍的非常详细,需要的朋友可以参考借鉴,下面随着小编来一起学习学习吧

    validator_v10:游乐场验证器

    验证器——v10 前言 下载和介绍 ...参考文档 ...特色 通过使用验证标签或自定义验证程序进行跨段和跨结构验证 ...提取自定义的片段名称,例如可以指定在验证时提取JSON名称,进入其在结果FieldError中可用

    如何自定义Struts2表单验证后的错误信息显示格式_好资源0分送

    前面一段时间学过一些Struts2的知识,感觉Struts2和1.x还是有很大的差别的,我还不好说1.x肯定会过时还是2.0会很快流行,这毕竟是需要作为导向的。 在Struts2中验证真的比较容易,可以在Action中直接写validate,也...

    validator:

    提取自定义定义的字段名称,例如可以指定在验证时提取JSON名称,并将其在结果FieldError中可用 可自定义的i18n感知错误消息。 Web框架的默认验证器; 从gin中的v8升级到v9的方法请参见 安装 使用go get。 go get ...

    低清版 大型门户网站是这样炼成的.pdf

    2.6.2 定义和使用拦截器栈 97 2.6.3 使用自定义拦截器 98 2.7 小结 100 第3章 struts 2标签库详解与ajax技术应用 103 3.1 struts 2主题与模板 103 3.2 struts 2控制标签详解 105 3.2.1 if/elseif/else标签详解...

    Struts2+API+标签全解+网页说明

    非用户标签:数据访问、逻辑控制等。 AJAX标签:支持AJAX技术...fielderror标签:输出异常提示信息。 tabbedPanel:AJAX标签,生成HTML中的Tab页。 tree标签:生成一个树形结构。 treenode标签:生成树形结构的节点。

    struts2输入校验总结

    struts2输入校验总结,struts2自带的校验器,以及校验器不能做的check的处理的总结

Global site tag (gtag.js) - Google Analytics