lemon oa前端页面——common公共页面研究

来源:互联网 发布:淘宝网男装冬季牛仔裤 编辑:程序博客网 时间:2024/04/30 04:28
/webapp/common目录


1、taglibs.jsp定义了所有的taglib,包括spring, spring security, jstl core, jstl fmt, jstl functions以及自定义标签,


   <%pageContext.setAttribute("ctx", request.getContextPath());%> 定义了上下文(如:lemon);
   <%pageContext.setAttribute("locale", request.getLocale());%> 定义了本地语言(如:en_US或zh_CN);


   关于自定义标签,在/webapp/WEB-INF/tags目录中定义,后面在专门介绍(TODO);


2、s.jsp定义了所有的公共脚本script,包括jquery, bootstrap等;
   其中引入一个脚本文件如:<script type="text/javascript" src="${ctx}/s/table/messages_${locale}.js"></script>
   /webapp/s/table/目录中包含了messages_en_US.js和messages_zh_CN.js,这样就提供了国际化的支持;
   
   同时也定义了showMessage, datepicker, datetimepicker, chzn-select等表单的option;


3、meta.jsp定义页面的meta信息
   <meta http-equiv="Content-Type" content="text/html;charset=utf-8" />
   <meta http-equiv="Cache-Control" content="no-store" />
   <meta http-equiv="Pragma" content="no-cache" />
   <meta http-equiv="Expires" content="0" />


4、错误页面
   401.jsp
   关键
   <%@ page contentType="text/html;charset=UTF-8" isErrorPage="true" %>
   <%response.setStatus(200);%>
   200表示服务器成功返回网页,这样IE就不会把其当做错误而显示IE自定义的错误页面。
   
   403.jsp
   404.jsp
   关键
   基本上和401.jsp一致,只是多了一个注销的按钮,调用的spring security提供的方法
   <li><a class="btn" href="${ctx}/j_spring_security_logout"><spring:message code="core.404.logout" text="注销"/></a></li>
   
   500.jsp
   关键
   基本上和401.jsp一致,只是多了一个显示详情的按钮
   <li><a class="btn" href="javascript:void(0);" onclick="$('#output').show();$('#targetContentDiv').hide();">显示详情</a></li>


5、登陆页面login.jsp
   ${scopePrefix}是applicationContext-filter.xml->scopeFilter->ScopeFilterFactoryBean->processMock()->MockScopeFilter->doFilter()中设置的
   ( request.setAttribute("scopePrefix", request.getContextPath()); )
   
   布局
   <div class="row-fluid">
  <div class="span3"></div>
  <!-- start of main -->
     <section class="span6"></section>
  <!-- end of main -->
  <div class="span3"></div>
   </div>
   
   验证
   j_spring_security_check
   j_username, j_password
   ${sessionScope['SPRING_SECURITY_LAST_EXCEPTION'].message}
   ${sessionScope['SPRING_SECURITY_LAST_USERNAME']}
0 0
原创粉丝点击