【问题标题】:Struts 2 optiontransferselect tag not working in jsp?Struts 2 optiontransferselect标签在jsp中不起作用?
【发布时间】:2013-11-27 03:17:01
【问题描述】:

我正在尝试执行以下包含 optiontransferselect 标记的 jsp 代码。但是我收到以下异常:

org.apache.jasper.JasperException: /abc.jsp(10,0) No tag "optiontransferselect label" defined in tag library imported with prefix "s"

请找到我使用的以下代码。

<%@ page language="java" contentType="text/html; charset=ISO-8859-1" pageEncoding="ISO-8859-1"%>
<%@ taglib prefix="s" uri="/struts-tags"%>
<html>
<head>
<title>Optiontransferselect Tag Example!</title>
</head>
<body>
<s:form>
<s:optiontransferselect label="Employee Records" name="leftSideEmployeeRecords" leftTitle="RoseIndia" rightTitle="JavaJazzUp" list="{'Deepak Kumar', 'Sushil Kumar','Vinod Kumar','Deepak Monthy','Deepak Mihanti', 'Sushil Kumar', 'Ravi Kant Kumar'}" headerKey="headerKey" headerValue="--- Please Select ---" doubleName="rightSideEmployeeRecords" doubleList="{'Amar Deep Patel', 'Amit Kumar','Chandan Kumar', 'Noor Kumar','Tammana Kumari'}" doubleHeaderKey="doubleHeaderKey" doubleHeaderValue="--- Please Select ---" />
</s:form>
</body>
</html> 

请指导。

【问题讨论】:

  • Struts2 版本? web.xml 内容?
  • 您是否使用除 Struts 之外的任何其他 TLD。

标签: java javascript jsp struts2


【解决方案1】:

您在项目中使用的是旧版本的struts-core-xxx.jar。您使用的是2.3.16 或更高版本吗?

要使用 optiontransferselect 标签,您需要使用 struts-core-2.3.16 或更高版本..

【讨论】:

  • 不正确。你为什么这么认为?
【解决方案2】:

您需要包含&lt;s:head&gt; 标记,该标记会拖入一些javascript,这些javascript 是使&lt;s:optiontransferselect&gt; 标记工作所需的。

【讨论】:

    猜你喜欢
    • 2013-11-28
    • 2016-08-19
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多