Bean を使用して事前定義されたメッセージを表示しようとしています。次のファイルを作成しましたが、次のエラーが< me
発生します。自動コード ジェネレータを入力すると、タグが表示されません<message - resources>
!!!!
org.apache.jasper.JasperException: The Struts dispatcher cannot be found. This is usually caused by using Struts tags without the associated filter. Struts tags are only usable when the request has passed through its servlet filter, which initializes the Struts dispatcher needed for this tag. - [unknown location]
root cause
The Struts dispatcher cannot be found. This is usually caused by using Struts tags without the associated filter. Struts tags are only usable when the request has passed through its servlet filter, which initializes the Struts dispatcher needed for this tag. - [unknown location]
note The full stack traces of the exception and its root causes are available in the GlassFish Server Open Source Edition 3.1.2.2 logs.
struts.xml
<!DOCTYPE struts PUBLIC
"-//Apache Software Foundation//DTD Struts Configuration 2.0//EN"
"http://struts.apache.org/dtds/struts-2.0.dtd">
<struts-config>
<!-- Configuration for the default package. -->
<message-resources parameter="com/myapp/struts/messages"/>
<package name="default" extends="struts-default">
<result-types>
<result-type name="tiles" class="org.apache.struts2.views.tiles.TilesResult"/>
</result-types>
<action name="register">
<result type="tiles">register</result>
</action>
</package>
</struts-config>
register.jsp
:
<%@ taglib uri="http://struts.apache.org/tags-bean" prefix="bean" %>
<div id="Header">
<bean:message key="welcome.loggedin"/>
</div>
messages.properties
:
# -- welcome --
welcome.loggedin=You are logged in.
welcome.heading=Struts Applications in Netbeans!
welcome.message=It's easy to create Struts applications with NetBeans.
問題はjarファイルにあると思います
commons-digester-1.8.1.jar
commons-fileupload-1.2.1.jar
commons-io-1.3.2.jar
commons-lang-2.1.jar
commons-logging-1.1.jar
displaytag-1.2.jar
displaytag-export-poi-1.2.jar
displaytag-portlet-1.2.jar
freemarker-2.3.13.jar
jdom-1.1.jar
jstl-1.2.jar
junit-3.8.1.jar
ognl-2.6.11.jar
pagertag.jar
sqlite-jdbc-3.7.2.jar
struts2-convention-plugin-2.1.6.jar
struts2-core-2.1.6.jar
struts2-dojo-plugin-2.1.2.jar
struts2-tiles-plugin-2.1.6.jar
tiles-api-2.1.2.jar
tiles-compat-2.1.2.jar
tiles-core-2.1.2.jar
tiles-jsp-2.1.2.jar
tiles-servlet-2.1.2.jar
struts-taglib-1.3.10.jar
xwork-2.1.2.jar