0

我使用 Netbeans IDE v7.1 + Struts 2/XWork 插件与 Struts 2.2.3 库和 Glassfish Server v3 http://plugins.netbeans.org/plugin/39218

我还从这里集成了 Struts2-Jquery 插件: Google Code 的插件页面

我下载的文件是:struts2-jquery-plugin-3.3.0.jar

首先,我将它作为 JAR/文件夹库添加到项目中。

接下来,我将示例代码复制到一个 JSP 页面中,结构如下:

            <%-- 
                Document   : calendarDemo
                Created on : 18-abr-2012, 17:48:08
                Author     : David32
            --%>

            <%@ taglib prefix="s" uri="/struts-tags"%>
            <%@ taglib prefix="sj" uri="/struts-jquery-tags"%>
            <html>
              <head>
                <sj:head locale="es" jquerytheme="lightness"/>
                <title>Datepicker Demo</title>
              </head>
              <body>
                <s:form id="form" theme="xhtml">
                  <sj:datepicker id="date0" name="date0" label="With Button Panel" showButtonPanel="true"/>
                  <sj:datepicker id="date1" name="date1" label="Change Month and Year" changeMonth="true" changeYear="true"/>
                  <sj:datepicker id="date2" name="date2" label="Custom Button Text" showOn="both" buttonText="Select a Date"/>
                  <sj:datepicker id="date3" name="date3" label="Show only on Button Click" showOn="button"/>
                  <sj:datepicker id="date4" name="date4" label="Text after selection" appendText=" (dd.MM.yy)" displayFormat="dd.MM.yy"/>
                  <sj:datepicker id="date5" name="date5" label="With fast slideDown Animation" showAnim="slideDown" duration="fast"/>
                  <sj:datepicker id="date6" name="date6" label="With slow fadeIn Animation" showAnim="fadeIn" showOptions="{direction: 'up' }" duration="slow" />
                  <sj:datepicker id="date7" name="date7" label="Show 3 Months" numberOfMonths="3"/>
                  <sj:datepicker id="date8" name="date8" label="Show Month Array" numberOfMonths="[2,3]"/>
                  <sj:datepicker id="date9" name="date9" label="Show Years only from 2008 until 2012" yearRange="2008:2012" changeYear="true"/>
                  <sj:datepicker id="date10" name="date10" label="Button Only" buttonImageOnly="true"/>
                  <sj:datepicker id="date11" name="date11" label="Without Button" showOn="focus"/>
                  <sj:datepicker id="date12" name="date12" label="With Close Event" onClose="onClose"/>
                </s:form>
              </body>
            </html>

web.xml中配置的起始页当然是[b]calendars/calendarDemo.jsp[/b]

Netbeans 未检测到任何错误,因为正确检测并检查了 Datepicker 标记。另一方面,在部署后它只给出一个错误 500 页面,并带有以下通知:

            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]

有人知道我是否缺少配置此插件的任何东西吗?任何帮助都感激不尽 !

我很乐意将整个异常日志粘贴到另一篇文章中,因为当前的文章已经太长了。

4

1 回答 1

0

正如用户@Umesh Awasthi 所评论的,这是插件的一个已知问题。

一种解决方法是降级到插件的 3.2.1 版本。

于 2012-04-20T01:03:49.967 回答