我在JSP中有下面的一段scriptlet代碼。如何從pageContext中將屬性值轉換爲JSP內的scriptlet代碼
<%
String instockMessage = pageContext.getAttribute("instockMessage");
if ((instockMessage != null) && (instockMessage.trim().length() != 0)) {
instockMessage = instockMessage.replaceAll("<[^>]*>", "").trim();
pageContext.setAttribute("instockMessage", instockMessage);
}
%>
但是,我收到一個錯誤,說編譯時出現「:類型不匹配:無法從Object轉換爲String」。
有誰知道如何解決這個問題?
工作....謝謝! – 2013-03-25 13:03:40
再次感謝你...... – 2013-03-25 13:08:50