【问题标题】:Dojo plugin not working in Struts 2Dojo 插件在 Struts 2 中不起作用
【发布时间】:2014-05-11 18:29:53
【问题描述】:

我的代码中没有一个 ajax 标签在工作。 我只是想使用 tabbedpanel,但它没有显示。 我的代码是:

tabbedpanel.jsp

    <%@ taglib uri="/struts-tags" prefix="s" %>
<%@ taglib uri="/struts-dojo-tags" prefix="sx" %>
<%@ page language="java" contentType="text/html; charset=ISO-8859-1"
    pageEncoding="ISO-8859-1"%>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<sx:head debug="true" cache="false" compressed="false" />

<title>Insert title here</title>
</head>
<body>
<s:form>
<sx:tabbedpanel id="tabContainer">
   <sx:div id="one" label="Tab 1" theme="ajax">
  first tab<br><br>
  </sx:div>

  <sx:div id="two" label="Tab 2" theme="ajax">
   second Tab<br><br>
  </sx:div>
      </sx:tabbedpanel>
      <s:submit value="submit" ></s:submit>
      </s:form>
</body>
</html>

tabs.java

    package com.heman;

import com.opensymphony.xwork2.ActionSupport;

public class tabs extends ActionSupport {

    @Override
    public String execute() throws Exception {
        // TODO Auto-generated method stub
    return SUCCESS;
    }
}

struts.xml

<?xml version="1.0" encoding="UTF-8"?>

<struts>
<package name="tabb" extends="struts-default">
<action name="tab" class="com.heman.tabs">
<result name="success">tabbedpanel.jsp</result>
</action>
</package>
</struts>

它没有显示在选项卡式面板中,但它简单地显示在同一个地方。

【问题讨论】:

    标签: java jsp struts2 dojo struts2-jquery


    【解决方案1】:

    Dojo 标签已弃用,请使用 jQuery 标签

    <%@ taglib prefix="sj" uri="/struts-jquery-tags" %>
    <head>
      <link href="<s:url value="/css/template_styles.css"/>" type="text/css" rel="stylesheet">
      <sj:head jqueryui="true" />
      <title></title>
    </head>
    <sj:tabbedpanel id="localtabs" cssClass="list">
        <sj:tab id="tab1" target="jsp" label="JSP Code"/>
        <sj:tab id="tab2" target="javascript" label="JavaScript"/>
      <sj:tab id="tab3" target="java" label="Java"/>
        <div id="jsp">JSP</div>
        <div id="javascript">JavaScript</div>
        <div id="java">Java</div>
    </sj:tabbedpanel>
    

    查找插件注册表以下载jQuery plugin

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2013-04-02
      • 2013-02-18
      • 2019-08-08
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多