错误:无法加载类'dijit / layout / ContentPane'

时间:2012-12-27 09:54:55

标签: java jsp dojo

我在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' 用萤火虫检查时。

1 个答案:

答案 0 :(得分:1)

似乎dijit.layout.ContentPane不在类路径中。尝试添加它或尝试更改require的{​​{1}}以查看是否已修复。

Here就是一个例子。