0

我在 JSP 页面上使用 Dojo 1.6.1。

<html>
<%@include file="includes/head.jsp" %>
<body class="tundra">
    <div 
        id="appLayout" 
        class="demoLayout" 
        data-dojo-type="dijit.layout.BorderContainer" 
        data-dojo-props="design: 'headline'"
        style="width: 100%; height: 100%">

    <div 
        class="edgePanel"
        data-dojo-type="dijit/layout/ContentPane" 
        data-dojo-props="region:'top'">

        <%@include file="includes/headline.jsp" %>

    </div>

    <div 
        class="edgePanel" 
        data-dojo-type="dijit.layout.ContentPane" 
        data-dojo-props="region: 'center'">
    .........

head.jsp 的内容

<head>
<meta charset="utf-8">
    <link rel="stylesheet" href="<%=request.getContextPath()%>/dojo.1.6.1/dijit/themes/tundra/tundra.css">
    <link rel="stylesheet" href="<%=request.getContextPath()%>/dojo.1.6.1/dojo/resources/dojo.css">
    <link rel="stylesheet" href="<%=request.getContextPath()%>/css/main.css">
    <style type="text/css">
    </style>
<script src="<%=request.getContextPath()%>/dojo.1.6.1/dojo/dojo.js"
        djConfig="parseOnLoad: true, isDebug: true">
</script>
<script>
    dojo.require("dojo.parser");
    dojo.require("dijit.layout.BorderContainer");
    dojo.require("dijit.layout.ContentPane");
</script>
</head>

部署时,我收到 javascript 错误。 Could not load class 'dijit/layout/ContentPane' 当用萤火虫检查时。

4

1 回答 1

1

似乎dijit.layout.ContentPane不在类路径中。尝试添加它或尝试更改requireadefine以查看是否修复。

是示例。

于 2012-12-27T14:36:47.333 回答