taglib使用

1.**List.jsp

<%@ taglib prefix="table" tagdir="/WEB-INF/tags/table" %>
<html>
<head>...head>
<body class="gray-bg">
    <shiro:hasPermission name="storage:goodsInputBean:add">
    <table:addRow url="${ctx}/storage/goodsInputBean/form1" title="商品入库" label="入库">table:addRow>
    shiro:hasPermission>

3.addRow.tag(”WebContent/WEB-INF/tags/table/addRow.tag”)

<%@ tag language="java" pageEncoding="UTF-8"%>
<%@ include file="/webpage/include/taglib.jsp"%>
<%@ attribute name="url" type="java.lang.String" required="true"%>
<%@ attribute name="title" type="java.lang.String" required="true"%>
<%@ attribute name="width" type="java.lang.String" required="false"%>
<%@ attribute name="height" type="java.lang.String" required="false"%>
<%@ attribute name="target" type="java.lang.String" required="false"%>
<%@ attribute name="label" type="java.lang.String" required="false"%>

<button class="btn btn-white btn-sm" data-toggle="tooltip" data-placement="left" onclick="add()" title="添加"><i class="fa fa-plus">i> ${label==null?'添加':label}button>
<%-- 使用方法: 1.将本tag写在查询的form之前;2.传入table的id和controller的url --%>
<script type="text/javascript">
    function add(){
        openDialog("新增"+'${title}',"${url}","${width==null?'800px':width}", "${height==null?'500px':height}","${target}");
    }
script>

你可能感兴趣的:(taglib使用)