有誰用過spring的tag的,進來幫個忙。

litanjun發表於2004-12-23
程式如下
<%@ taglib prefix="spring" uri="/spring" %>
<%@ page language="java" contentType="text/html; charset=GBK" pageEncoding="GBK"%>
<html> <title><spring:message code="register_title"/></title> </head>
<body>

<!--使用者註冊-->
<spring:message code="username_label"/>
</body>
</html>
但是程式在丟擲異常java.lang.IllegalStateException: No WebApplicationContext found: not in a DispatcherServlet request
看來spring程式碼,是因為ServletContext是空的。也就是struts的那個org.apache.struts.tiles.ComponentContext是空的。

相關文章