2012-12-27 91 views
0

我在JSP頁面上使用Dojo 1.6.1。 head.jsp的錯誤:無法加載類'dijit/layout/ContentPane'

<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> 
<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

似乎dijit.layout.ContentPane不在類路徑中。嘗試添加它或嘗試更改requiredefine以查看是否修復。

Here就是這個例子。