jsp java: my tag files don't replace parameters
script.tag:
<%@ attribute name="file" required="true"%>
<script type="text/javascript" src="/path/to/${file}"></script>
my.jsp
<%@ page l开发者_运维百科anguage="java" contentType="text/html; charset=UTF-8"
pageEncoding="UTF-8"%>
<%@ taglib tagdir="/WEB-INF/tags" prefix="x"%>
<x:script file="register.js"/>
however, the ${file}
param does not get replaced and stays literally ${file}
Help!
Did you try adding pageScope when you use the attribute in the tag? Like this:
<script type="text/javascript" src="/path/to/${pageScope.file}"></script>
Moving to tomcat 6 fixed this.
精彩评论