最近搜索

jsp jstl layui模板

浏览:833
管理员 2022-03-19 01:49

html头如何写

<%@ page language="java" contentType="text/html; charset=UTF-8"
	pageEncoding="UTF-8"%>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>

<!-- JSTL -->
<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c"%>
<%@ taglib prefix="fmt" uri="http://java.sun.com/jsp/jstl/fmt"%>
<!-- JSTL -->

${config.headStr}
${config.layuiStr}


格式化时间


[<span style="margin-right: 15px;"><fmt:formatDate value="${blog.createDateTime}" pattern="yyyy-MM-dd HH:mm"/></span>



显示文字或者html内容

${config.headStr}
${config.layuiStr}

<title>${blog.title} - ${config.web_name}</title>
<meta name="keywords" content="${blog.keywords }" />
<meta name="description" content="${blog.description_}"/>
<!--添加 公共css -->
<link rel="stylesheet"	href="/static/css/pc/base.css?version=${config.banben}">
<!--添加 公共css -->

				
<div class="blog_content">
	${blog.content }
</div>



引用jsp模板include

	<!-- 临时模块 -->
	<jsp:include page="/pc/component/temp.jsp"/>
	<!-- 临时模块 -->
	
	<!-- 加载底部 模块 -->
	<jsp:include page="/pc/component/food.jsp"/>
	<!-- 加载底部 模块 -->	



if判断

<c:if test="${lunboList[0].type==1}">
						<a style="display: block;" href="${lunboList[0].url}" title="${lunboList[0].title}">
							<img alt="${lunboList[0].title}" src="${lunboList[0].image_url}" />
						</a>
					</c:if>
					
					<c:if test="${lunboList[0].type==2}">
						<a target="_blank" style="display: block;" href="${lunboList[0].url}" title="${lunboList[0].title}">
							<img alt="${lunboList[0].title}" src="${lunboList[0].image_url}" />
						</a>
					</c:if>


if判断   修改用户资料 ,是否 显示 密码


	  
	  
	  <c:choose>
			    <c:when test="${user!=null}">
			    	<input type="hidden" id="password" autocomplete="off" value=""  v-model="password"  placeholder="请输入密码" class="layui-input">
			    </c:when>
			     
			     
			     <c:when test="${user==null }">
			     	<div class="layui-form-item">
					    <label class="layui-form-label">密码</label>
					    <div class="layui-input-block">
						      <input type="text" id="password" autocomplete="off" value="${user.password}" v-model="password" placeholder="请输入密码" class="layui-input">
					    </div>
					  </div>
			     </c:when>
	</c:choose>	


判断list的大小,不为空


<%@ page language="java" contentType="text/html; charset=UTF-8"
	pageEncoding="UTF-8"%>
<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c"%>
<%@ taglib prefix="fmt" uri="http://java.sun.com/jsp/jstl/fmt"%>
<%@ taglib prefix="fn" uri="


 
<ul class="layui-nav" style="margin-left: 0px;">
	<c:forEach var="nav" items="${navList}" varStatus="status">
		<li    class="layui-nav-item">
		  	<a href="${nav.url}" >${nav.name}</a>
		  	<c:if test="${nav.child!=null && fn:length(nav.child)>0}">
                <dl   class="layui-nav-child">
                	<c:forEach var="nav2" items="${nav.child}"  >
                		<dd ><a  href="${nav2.url}"   >${nav2.name}</a></dd>
                	</c:forEach>    
			    </dl>
			</c:if>
		  </li>
	</c:forEach>     
</ul>


for循环

							
							<c:forEach var="link" items="${linkList}" varStatus="status">
								<a target="_blank" href="${link.url }">${link.name }</a>
							</c:forEach>							


多重for循环


  <c:forEach var="tree" items="${treeList }">
  <li class="layui-nav-item layui-nav-itemed">
    <a href="javascript:;">${tree.text}</a>
    <dl class="layui-nav-child">
    	<c:forEach var="child" items="${tree.children}">
    		<dd id="${child.dd_id}" url="${child.url}" type="${child.type}" text="${child.text}"><a style="cursor:pointer;"><i class="layui-icon">${child.iconCls }</i>&nbsp; ${child.text}</a></dd>
    	</c:forEach>
    </dl>
  </li>
  </c:forEach>


include的模板如何写


<%@ page language="java" contentType="text/html; charset=UTF-8"
	pageEncoding="UTF-8"%>
<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c"%>
<%@ taglib prefix="fmt" uri="http://java.sun.com/jsp/jstl/fmt"%>


<div class="model" style="background-color: #0c0d0e;">

</div>




layui下拉框 如何写

<label class="layui-form-label">分类</label>
	    <div class="layui-input-inline" style="width: 150px; margin-right: 0px;">
	      <select id="blogFenLeiId" lay-filter="blogFenLeiId">
	      	<option value="" selected="">全部</option>
	      	<c:forEach var="blogFenLei" items="${blogFenLeiList}" >
	      		<option value="${blogFenLei.id}">${blogFenLei.name }</option>
	      	</c:forEach>
	      </select>
	    </div>



css样式如何写


<!-- 引入manage 的基础css -->
<script	src="${pageContext.request.contextPath}/static/js/houtai/manage_base.js"></script>
<link href="${pageContext.request.contextPath}/static/css/houtai/manage_base.css" rel="stylesheet"/>
<!-- 引入manage 的基础css -->


文本域text如何写


   <tr>
	        <td>headStr</td>
	        <td>
	        	<textarea placeholder="headStr" class="layui-textarea">${config.headStr }</textarea>
	        </td>
	      </tr>


img如何写


<img style="width: 40px; height: 40px;" alt="" src="${config.houtai_logo } " onclick="seeImg('${config.houtai_logo }')" />


input如何设置值


<div class="layui-form-item">
				<label class="layui-form-label">网址</label>
				<div class="layui-input-block">
					<input type="text" autocomplete="off" v-model="web_site"
						value="${config.web_site }" placeholder="请输入  网址  " class="layui-input">
				</div>
			</div>



如何使用shiro


    
    <label class="layui-form-label" style="width: 60px;">油站</label>
    <div class="layui-input-inline" style="    width: 141px;">
    
	   	<shiro:hasPermission name="his:allSee">
		   	<select name="stationId" id="stationId" lay-filter="stationId">
				<c:forEach var="station" items="${stationList}" >
					<option value="${station.id}">${station.name}</option>
				</c:forEach>
			</select>
		</shiro:hasPermission>
		
		<shiro:lacksPermission name="his:allSee">
		      <select id="stationId" name="stationId" lay-filter="stationId"  >
		        <option value="${currentUser.stationId }" selected="">${currentUser.station.name }</option>
		      </select>
		</shiro:lacksPermission>
    </div>



js中如何使用 文字 


//打开编辑窗口
function open_edit(id){
	w = 600;
	h = 300;
	checkWindow();
	layer.open({
	  type: 2,
	  title: '修改 ${title} ',
	  shadeClose: true,
	  shade: 0.8,
	  area: [w+'px', h+'px'],
	  content: '/houtai/jyz/qita/edit?title=${title}&id='+id //iframe的url
	});
}



layui初始化日期


		
		//日期
		  laydate.render({
		    elem: '#date'
		    ,value: '${dateStr}'
		    ,isInitValue: true
		  });		





联系站长

站长微信:xiaomao0055

站长QQ:14496453