博客
关于我
强烈建议你试试无所不能的chatGPT,快点击我
jsp自定义标签
阅读量:4230 次
发布时间:2019-05-26

本文共 1124 字,大约阅读时间需要 3 分钟。

1编写处理类:

public class ListTest {    public static List
getList(String string){ List
list=null; if("a".equals(string)){ list=new ArrayList
(Arrays.asList("aa","bb","cc","dd")); return list; }else{ list=new ArrayList
(Arrays.asList("AA","BB","CC","DD")); return list; } }}
2配置tld文件:

JSTL 1.1 functions library
JSTL functions sys
1.1
fns
http://java.sun.com/jsp/jstl/functionss
获取字典对象列表
getList
com.smart.shiro.ListTest
java.util.List getList(java.lang.String)
3 jsp中使用:

<%@ page contentType="text/html;charset=UTF-8" language="java" %><%@ taglib prefix="fnss" uri="/WEB-INF/fns.tld" %><%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %><%@ page isELIgnored="false" %>    
Title<% request.setAttribute("aaa","a");%>${
fnss:getList(aaa)}

[aa, bb, cc, dd]

转载地址:http://iljqi.baihongyu.com/

你可能感兴趣的文章
Creating a Digital Home Entertainment System with Windows Media Center
查看>>
Java Concurrency in Practice
查看>>
Red Hat Fedora 5 Unleashed
查看>>
AdvancED Flash Interface Design (Advanced Design)
查看>>
Quartz Job Scheduling Framework: Building Open Source Enterprise Applications
查看>>
C++ GUI Programming with Qt 4
查看>>
Effective Use of Microsoft Enterprise Library: Building Blocks for Creating Enterprise Applications
查看>>
Java For Artists: The Art, Philosophy, And Science Of Object-Oriented Programming
查看>>
Moodle E-learning Course Development
查看>>
VoIP For Dummies
查看>>
Administrator's Guide to SQL Server 2005
查看>>
Ajax Design Patterns
查看>>
DNS and BIND (5th Edition)
查看>>
Firewall Fundamentals
查看>>
Learning PHP and MySQL
查看>>
Agile Software Construction
查看>>
Computer Security Basics
查看>>
Sams Teach Yourself MySQL in 10 Minutes
查看>>
Information Systems : The State of the Field
查看>>
IPv6 Essentials
查看>>