<filter> <filter-name>FilterName</filter-name> <filter-class>TestFilter</filter-name> <init-param> <param-name>test-param</param-name> <param-value>test-value</param-name> </init-param> </filter> <filter-mapping> <filter-name>TestFilter</filter-name> <url-pattern>/*</url-pattern> </filter-mapping>
DiskFileItemFactory factory = new DiskFileItemFactory(); // 设置内存中存储文件的最大值 factory.setSizeThreshold(maxMemSize); // 本地存储的数据大于 maxMemSize. factory.setRepository(new File("c:\\temp")); // 创建一个新的文件上传处理程序 ServletFileUpload upload = new ServletFileUpload(factory); // 设置最大上传的文件大小 upload.setSizeMax( maxFileSize ); // 解析上传的文件 List fileItems = upload.parseRequest(request);
<fmt:formatNumber value="${balance}" type="currency"/>
<c:if test="${fn:contains(theString, 'test')}"> <p>Found test string<p> </c:if>
<sql:setDataSource var="snapshot" driver="com.mysql.jdbc.Driver" url="jdbc:mysql://localhost/test" user="root" password="123456"/>
<sql:query dataSource="${snapshot}" var="result"> SELECT * FROM users; </sql:query>
<sql:query dataSource="${snapshot}" var="result"> SELECT * FROM users WHERE id = ?; <sql:param value="${userId}"/> </sql:query>
<taglib> <tlib-version>1.0</tlib-version> <jsp-version>2.0</jsp-version> <short-name>Test TLD</short-name> <tag> <name>hello</name> <tag-class>com.pc.HelloTag</tag-class> <body-content>empty</body-content> </tag> </taglib>
public class HelloTag extends SimpleTagSupport { public void doTag() { JspWriter out = getJspContext().getOut(); out.println("Hello world!"); } }
<body-content>scriptless</body-content>
StringWriter writer = new StringWriter(); getJspBody().invoke(writer);
<tag> <attribute> <name>message</name> </attribute> </tag>
// 由系统自动调用。 public void setMessage(String message) { this.message = message; }
JSP简明教程(五):高级特性,布布扣,bubuko.com
原文地址:http://blog.csdn.net/caipeichao2/article/details/38665075