I have a GWT application that need to set html field from java code(GWT)
i tried this but element is always null
Element element = Document.get().getElementById("elementID");
if (element != null)
{
GWT.log("found element with id:" + "elementID");
// some code....
}
Project structure:
|---Main.html: page that loads compiled module
|---page.html: the page that need to be updated from GWT
So my question, is it possible to set field in page.html from GWT code, if so how??
Note: page.html is show after clicking anchor defined like this:Anchor
anchor = new Anchor(
"message",
false,
"page.html",
"_blank");
EDIT:
Page.html:
<html>
<head>
<link href="http://ajax.googleapis.com/ajax/libs/jqueryui/1.8/themes/base/jquery-ui.css" rel="stylesheet" type="text/css"/>
<script src="http://ajax.googleapis.com/ajax/libs/jquery/1.5/jquery.min.js"></script>
<script src="http://ajax.googleapis.com/ajax/libs/jqueryui/1.8/jquery-ui.min.js"></script>
</head>
<body style="font-size:62.5%;">
<div align="center" width="100%" height="80%">
<table height="80%" width="40%">
<tr valign="bottom">
<td align="center">
<div id="progressbar"></div>
</td>
<td><a id="cancel" href="#"><img src="close_icon_x.png" height="32px" width="32px"/></a></td>
</tr>
<tr><td valign="top"><div id ="elementID"></div>
</td><td></td></tr>
</table>
</div>
</body>
</html>
Main.html:
<html>
<head>
<meta http-equiv="content-type" content="text/html; charset=UTF-8">
<script type="text/javascript" language="javascript" src="project/MyProject.nocache.js"></script>
<link media="all" type="text/css"
href="http://ajax.googleapis.com/ajax/libs/jqueryui/1.8.6/themes/base/jquery-ui.css" rel="stylesheet">
<script src="https://ajax.googleapis.com/ajax/libs/jquery/1.4.4/jquery.min.js"
type="text/javascript" charset="utf-8"></script>
<script src="https://ajax.googleapis.com/ajax/libs/jqueryui/1.8.6/jquery-ui.min.js"
type="text/javascript" charset="utf-8"></script>
<link type="text/css" rel="stylesheet" href="Style.css">
</head>
-->
<body>
<noscript>
<div style="width: 22em; position: absolute; left: 50%; margin-left: -11em; color: red; background-color: white; border: 1px solid red; padding: 4px; font-family: sans-serif">
Your web browser must have JavaScript enabled
in order for this application to display correctly.
</div>
</noscript>
</body>
</html>
I think the solution is similar to one in this post:
GWT: DOM.getElementById doesn't work!
Indeed Riley is correct, where did you define the elementId ?
You can set the field. The problem solution is in why you do get a null pointer.
UPDATE: Are you sure the actual page.html code has been rendered before the invocation of getElementID else you will always get Null.
Related
this is my html code.but the ngRepeat div show as commented in browser inspector
enter image description here
<
html ng-app="myApp">
<head>
<link rel="stylesheet" href="script/bootstrap.css">
<script src="script/tuto.js"></script>
<script type="text/javascript" src="script/angular.js"></script>
<script type="text/javascript" src="script/angular.min.js"></script>
<script type="text/javascript" src="script/bootstrap.js"></script>
<script type="text/javascript" src="script/bootstrap.min.js"></script>
<link rel="stylesheet" href="css/app.css">
<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1">
<title>Insert title here</title>
</head>
<body style="padding: 50px" ng-controller="ctrl">
<div>
<p>
<input type="text" placeholder="Search..." ng-model="searchFor"
size="20" />
</p>
<div class="album panel panel-primary" ng-repeat="album in albums">
<div class="panel-heading">
{{ album.title }}
<div style="float: right">{{ album.date }}</div>
</div>
<div class="description">{{ album.description }}</div>
</div>
</div>
<p>
<input type="text" placeholder="Search..." ng-model="searchFor"
size="20" />
</p>
<div class="album panel panel-primary" ng-repeat="album in albums">
<div class="panel-heading">
{{ album.title }}
<div style="float: right">{{ album.date }}</div>
</div>
<div class="description">{{ album.description }}</div>
</div>
<h3>Add new Album</h3>
<div class="album panel panel-success" ng-repeat="album in albums">
<div class="panel-heading">
{{ album.title }}
<div style="float: right">{{ album.date }}</div>
</div>
<div class="description">{{ album.description }}</div>
</div>
</body>
</html>
enter code here
This is the HTML code.it's also have the script part for angularJs.but the ngRepaet div showed as commented in browser inspector
You should write script in another file and add ng-app
Here is plnkr
https://plnkr.co/edit/yvJGX52osH9eTJggexec?p=preview
your problem is you include file script above angular.js . include below and problem will solved
<link rel="stylesheet" href="script/bootstrap.css">
<script> type="text/javascript" src="script/angular.js"></script>
<script> type="text/javascript" src="script/angular.min.js"></script> <script> type="text/javascript" src="script/bootstrap.js"></script>
<script type="text/javascript" src="script/bootstrap.min.js"></script>
<link rel="stylesheet" href="css/app.css">
<script src="script/tuto.js"></script> //include below
#Thanh check this..this is the file
I've tried everything to select this facebook button, by css, by partial link, by xpath. Can someone show me the syntax? HTML Code is below, the element is highlighted in blue.
This is the html for facebook Iframe login
<html>
<head>
<style type="text/css">
<title>My Photo Tab</title>
<base href="/">
<script src="https://apis.google.com/_/scs/apps-static/_/js/k=oz.gapi.en.U-RewQuh4JY.O/m=signin_annotation/exm=client,plusone/rt=j/sv=1/d=1/ed=1/am=AQ/rs=AGLTcCNj6EO7Q-0o28iG5EwDca54BMQrpw/t=zcms/cb=gapi.loaded_2" async="">
<script src="https://apis.google.com/_/scs/apps-static/_/js/k=oz.gapi.en.U-RewQuh4JY.O/m=plusone/exm=client/rt=j/sv=1/d=1/ed=1/am=AQ/rs=AGLTcCNj6EO7Q-0o28iG5EwDca54BMQrpw/t=zcms/cb=gapi.loaded_1" async="">
<script type="text/javascript" async="" src="//assets.pinterest.com/js/pinit_main.js">
<script id="adblade-sdk" src="http://web.adblade.com/js/ads/async/show.js">
<script id="facebook-jssdk" src="//connect.facebook.net/en_US/sdk.js">
<script id="google-platform-js" src="http://apis.google.com/js/platform.js" gapi_processed="true">
<script id="twitter-wjs" src="http://platform.twitter.com/widgets.js">
<script async="" src="//www.google-analytics.com/analytics.js">
<script src="https://apis.google.com/_/scs/apps-static/_/js/k=oz.gapi.en.U-RewQuh4JY.O/m=client/rt=j/sv=1/d=1/ed=1/am=AQ/rs=AGLTcCNj6EO7Q-0o28iG5EwDca54BMQrpw/t=zcms/cb=gapi.loaded_0" async="">
<script>
<link rel="stylesheet" href="assets/css/bootstrap.min.css?gb=0.0.3">
<link rel="stylesheet" href="assets/css/jquery.simplecolorpicker.css?gb=0.0.3">
<link rel="stylesheet" href="assets/css/style.css?gb=0.0.3">
<link rel="stylesheet" href="assets/css/shared.css?gb=0.0.3">
<link rel="stylesheet" href="assets/css/home.index.css?gb=0.0.3">
<link rel="stylesheet" href="assets/css/home.modals.css?gb=0.0.3">
<link rel="stylesheet" href="assets/css/languageSize.css?gb=0.0.3">
<link rel="stylesheet" href="assets/css/chosen/chosen.min.css?gb=0.0.3">
<link rel="stylesheet" href="assets/css/lp2.css?gb=0.0.3">
<meta content="http://myphototab.com" property="og:url">
<meta content="Your social photos on your new tab page!" property="og:title">
<meta content="http://cdn.myphototab.com/content/images/social.jpg" property="og:image">
<meta content="My Photo Tab" property="og:site_name">
<meta content="Turn your browser's boring new tab page into your personalized photo gallery!" property="og:description">
<meta content="summary_large_image" name="twitter:card">
<meta content="MyPhotoTab" name="twitter:site">
<meta content="MyPhotoTab" name="twitter:creator">
<meta content="Your social photos on your new tab page!" name="twitter:title">
<meta content="Turn your browser's boring new tab page into your personalized photo gallery!" name="twitter:description">
<meta content="http://cdn.myphototab.com/content/images/social.jpg" name="twitter:image:src">
<link type="text/css" rel="stylesheet" href="http://staticd.cdn.adblade.com/css/zones/zone1101.css">
<style type="text/css">
<script type="text/javascript" async="" src="http://edge.quantserve.com/quant.js">
<script type="text/javascript" async="" src="http://b.scorecardresearch.com/beacon.js?c1=8&c2=6864322&c3=&c4=&c5=&c6=&c10=&c15=">
<link type="text/css" rel="stylesheet" href="http://staticd.cdn.adblade.com/css/zones/zone1101.css">
<style type="text/css">
<script type="text/javascript" async="" src="http://edge.quantserve.com/quant.js">
<script type="text/javascript" async="" src="http://b.scorecardresearch.com/beacon.js?c1=8&c2=6864322&c3=&c4=&c5=&c6=&c10=&c15=">
<style type="text/css">
<style type="text/css">
</head>
<body class="isFF isWindows loggedout page-loaded modal-open Large en" style="background-image: none; background-color: rgb(192, 192, 192); overflow-y: auto;" data-twttr-rendered="true">
<input id="IsFromExtension" type="hidden" value="true">
<div class="pageWrapper" ng-view="">
<section id="homeView">
<div class="container body-content" style="">
<div id="myModal" class="modal fade in" data-backdrop="static" data-keyboard="false" aria-hidden="false" aria-labelledby="myModalLabel" role="dialog" tabindex="-1" style="display: block; visibility: visible;">
<div onload="showModal()" ng-include="partialUrl.Base">
<div id="modalWelcome" class="modal-dialog" style="display: block;">
<div class="modal-content gray-border">
<button class="close" ng-click="welcomeClose({trackingData: ['2', 'index-welcome', 'welcome-popup-close', '']})" data-dismiss="modal" type="button">
<div class="modal-body" style="">
<div class="modal-body-inner">
<div class="language">
<div class="title center langDir" style="direction: ltr;">
<div class="subtitle2 center langDir" translate="" style="direction: ltr;">My Photo Tab allows you to see your social and other photos on your browser's new tab page - FREE!</div>
<div class="socialButtons">
<div class="socialButtonsInner">
<div class="fblogin">
<fblogin>
<div class="fbLoginInner">
<fb:login-button class=" fb_iframe_widget" onlogin="FacebookLoginState();" scope="public_profile,email,user_photos,user_friends,publish_actions" size="xlarge" login_text=" Login with Facebook " fb-xfbml-state="rendered" fb-iframe-plugin-query="app_id=860682337328409&container_width=147&locale=en_US&login_text=%0A%20%20%20%20%20%20%20%20Login%20with%20Facebook%0A%20%20%20%20&scope=public_profile%2Cemail%2Cuser_photos%2Cuser_friends%2Cpublish_actions&sdk=joey&size=xlarge">
<span style="vertical-align: bottom; width: 290px; height: 39px;">
<iframe class="" width="1000px" height="1000px" frameborder="0" name="f138e5757ce176" allowtransparency="true" scrolling="no" title="fb:login_button Facebook Social Plugin" style="border: medium none; visibility: visible; width: 290px; height: 39px;" src="http://www.facebook.com/v2.1/plugins/login_button.php?app_id=860682337328409&channel=http%3A%2F%2Fstatic.ak.facebook.com%2Fconnect%2Fxd_arbiter%2F6Dg4oLkBbYq.js%3Fversion%3D41%23cb%3Df135579120b2446%26domain%3Dmyphototab.com%26origin%3Dhttp%253A%252F%252Fmyphototab.com%252Ff21d55794e16b1c%26relation%3Dparent.parent&container_width=147&locale=en_US&login_text=%0A%20%20%20%20%20%20%20%20Login%20with%20Facebook%0A%20%20%20%20&scope=public_profile%2Cemail%2Cuser_photos%2Cuser_friends%2Cpublish_actions&sdk=joey&size=xlarge">
<!DOCTYPE html>
<html id="facebook" class="" lang="en">
<head>
<body class="plugin gecko win x1 Locale_en_US" dir="ltr">
<div class="_li">
<div class="pluginSkinLight pluginFontHelvetica">
<div id="u_0_0" class="pluginLoginButton pluginLoginButtonXlarge" style="width: 300px;">
<div>
<div id="u_0_1" class="_4z_b _4z_8 _4z_c" tabindex="0" role="button">
<table class="uiGrid _51mz" cellspacing="0" cellpadding="0">
<tbody>
<tr class="_51mx">
<td class="_51m-">
<td class="_51m- _51mw">
<span class="_4z_9">
<span class="_4z_f fwb">Login with Facebook</span>
First switch to the iframe using: (As Saifur told name seems to be dynamic hence identifying element based on title)
driver.switchTo().frame(driver.findElement(By.xpath("//iframe[contains(#title,'Facebook Social Plugin')]")));
then click on the span as
new WebDriverWait(driver, 10).until(ExpectedConditions.presenceOfElementLocated(By.xpath("//span[contains(.,'Login with Facebook')]"))).click();
That's no button, that's a span.
Try: //span[text()='Login with Facebook']
Try xpath text based search
//span[contains(text(),'Login with Facebook')]
However, depending on the element load time you may need to add some explicit wait as well.
By xpath = By.xpath("//span[contains(text(),'Login with Facebook')]");
WebElement myDynamicElement = (new WebDriverWait(driver, 10))
.until(ExpectedConditions.presenceOfElementLocated(xpath));
myDynamicElement.click();
Edit
Just saw that page contains iframe. So, you need to use switchTo() to set focus into iframe before start looking for the element. See the API doc
//Looks like the name of ifame is also dynamic
//driver.switchTo().frame("fbf1ab674");
//assuming that's the only iframe on
driver.switchTo().frame(driver.findElement(By.cssSelector('iframe')));
driver.findElement(By.xpath("//span[contains(text(),'Login with Facebook')]")).click();
//switch back to default content when done working inside iframe
driver.switchTo().defaultContent();
I suspect for the same reason linkText and cssSelector you have used did not work.
Also, please try to post html instead of image for future reference which is much easier to read and find possible issues.
With Firefox (firebug) and Chrome (chromebug), u can copy the xpath of each selected item. Very useful when developing with Selenium!
Check out this wikihow page and u will like it!
http://m.wikihow.com/Find-XPath-Using-Firebug
Meanwhile it should also be available in Firefox inspector.
I have this jsp code where I am trying to edit information for the user my web page. I am new to jsp programming and I'm experiencing errors. Here is my code:
<%#page import="DatabaseTransactions.UserPhotosDataContext"%>
<%#page import="java.sql.ResultSet"%>
<%#page contentType="text/html" pageEncoding="UTF-8"%>
<%
if (session.getAttribute("id") == null) {
response.sendRedirect(request.getContextPath() + "/sign-in.jsp");
}
int userId = Integer.parseInt(session.getAttribute("id").toString());
ResultSet userInfo = UserPhotosDataContext.getUserProfileInfo(userId);
%>
<!DOCTYPE html>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>Edit Information</title>
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<!-- Bootstrap -->
<link href="css/bootstrap.min.css" rel="stylesheet" media="screen">
<link href="styles.css" rel="stylesheet">
</head>
<body class="bodybg">
<jsp:include page="/navigation.jsp"/>
<% userInfo.next();%>
<div class="boxouter" style="margin-top:50px;">
<h3 class="muted">Edit Information</h3>
<!--- more code here---->
<br><br>
<form id="update-form" method="" action="">
<table style="margin:auto">
<tr>
<!--username-->
<td>
<label>Username <span id="uname-error" class="form-error"></span></label>
<input type="text" title="Use at least 6 characters"
name="username" id="uname"
value="<%=userInfo.getString("username")%>"
placeholder="Username" disabled="true">
</td>
<!--email-->
<td>
<label>Email <span id="email-error" class="form-error"></span></label>
<input type="text"
name="email" id="email"
value="<%=userInfo.getString("email")%>"
placeholder="Email" disabled="true">
</td>
</tr>
<!--- more code here---->
</table>
<center/>
<button class="btn btn-info" onclick="enablefields();" id="enablebtn" style="visibility:visible">Edit Information</button>
<a id="savelink" href="#" style="color:white;">
<button class="btn btn-info" id="savebtn" type="submit" style="visibility:hidden">Save</button>
</a>
<a href="#" style="color:white">
<button class="btn btn-info" id="deactivatebtn" style="visibility:visible">Deactivate Account</button>
</a>
</form>
</div>
</div>
<br><br>
<!--- more code here---->
<script type="text/javascript">
function setValues() {
if ("<%=userInfo.getString("gender")%>" == "Male")
$('select option:contains("Male")').prop('selected',true);
else if ("<%=userInfo.getString("gender")%>" == "Female")
$('select option:contains("Female")').prop('selected',true);
}
window.onload = setValues;
</script>
<script type="text/javascript" src="<%=request.getContextPath()%>/js/jquery.js"></script>
<script type="text/javascript" src="<%=request.getContextPath()%>/js/bootstrap.js"></script>
<script type="text/javascript" src="<%=request.getContextPath()%>/js/bootstrap.min.js"></script>
<script type="text/javascript" src="<%=request.getContextPath()%>/js/bootstrap-modal.js"></script>
<script type="text/javascript" src="<%=request.getContextPath()%>/js/bootstrap-popover.js"></script>
<script type="text/javascript" src="<%=request.getContextPath()%>/js/bootstrap-modalmanager.js"></script>
<script type="text/javascript" src="<%=request.getContextPath()%>/js/editinfo.js"></script>
<script type="text/javascript" src="<%=request.getContextPath()%>/js/holder.js"></script>
<script type="text/javascript" src="<%=request.getContextPath()%>/js/logout.js"></script>
<script type="text/javascript" src="<%=request.getContextPath()%>/js/bootstrap-dropdown.js"></script>
</body>
</html>
When I run it, I get this error:
org.apache.jasper.JasperException: An exception occurred processing
JSP page /editinfo.jsp at line 61
Line 61 is:
value="<%=userInfo.getString("email")%>"
I remove this line and it works perfectly fine (but I need this to get the value). When I keep line 61 and try to remove this:
value="<%=userInfo.getString("username")%>"
which is at line 52 of my page, it still doesn't work.
I also replace line 52 to line 61 and it works.
I also get these errors:
javax.servlet.ServletException: java.sql.SQLException: Column 'email' not found.
java.sql.SQLException: Column 'email' not found.
But I'm 100% sure that my database has an email column. Also, when I try this for the other columns of my database, it gives back the same error. It only works if it is "username" column. Please help me. How do I fix this?
the expression tags means <%= ....... >
has take semicolon (;) at the end of expression.
value='<%= userInfo.getString("email") ; %>'
I hope it will work ,please try this.
Try:
value "<%= userInfo.getString("email") %>"
or
value <%= userInfo.getString("email") %>
No ; when you use the <%= %> expression.
Also, I think you don't need two = signs, but only the one inside <%= %>.
Try the following way:
value='<%=userInfo.getString("email")%>'
Does that fix the problem? Actually single quotes might cause problems
since the original error is java.sql.SQLException forget about JSP errors for now.
Write some tests for UserPhotosDataContext.getUserProfileInfo(userId) so you can debug the ResultSet.
You're sure email is in the table - are you sure it's in the sql query ?
Also, check that you are retrieving the columns from the ResultSet in the order they appear in the ResultSet.
For example, if your ResultSet is:
email, username, ...
then trying to access email after you have already accessed username MIGHT not work.
I say MIGHT because this is probably specific to whatever database driver you are using - I came across this when using Sybase.
You need to try, (if you are using MySQL as DB) "MySQL Connector" jar file, add or (copy) to in your server lib folder.
I have a jsp file which displays a table with 5 columns, i want to have a button on the same page of table, which can download the contents of table in pdf format using jquery..Can anyone help me? I have added the lib files for jspdf to my projects js folder and provided their path in my jsp file as shown in below code, m not understanding whats going wrong can anyone help??
<%# page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"%>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<%#page import="org.apache.log4j.Level"%>
<%#page import="java.util.ArrayList"%>
<%#page import="sevices.authentication.AuthorizationException"%>
<head>
<meta name="keywords" content="" />
<meta name="description" content="" />
<meta http-equiv="content-type" content="text/html; charset=utf-8" />
<title>Intelligent System</title>
<link href="style.css" rel="stylesheet" type="text/css" media="screen" />
<script type='text/javascript' charset='utf-8' src='/ias/js/jquery.js'></script>
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<script type="text/javascript" src="/ias/js/jquery.dataTables.min.js"></script>
<script type="text/javascript" src="/ias/js/jsPDF.js"></script>
<script type="text/javascript" src="/ias/js/FileSaver.js"></script>
<script type="text/javascript" src="/ias/js/Blob.js"></script>
<script type="text/javascript" src="/ias/js/BlobBuilder.js"></script>
<script type="text/javascript" src="/ias/js/deflate.js"></script>
<script type="text/javascript" src="/ias/js/adler32cs.js"></script>
<link href="/ias/css/demo_page.css" rel="stylesheet" type="text/css" media="screen" />
<link href="/ias/css/demo_table.css" rel="stylesheet" type="text/css" media="screen" />
<script type="text/javascript" charset="utf-8">
$(document).ready(function() {
$('#example2').dataTable();
} );
$("#button3").click(function() {
var table = $("#example2").html();
$(".result").html(table);
var pdf = new jsPDF();
pdf.text(table);
pdf.save('message.pdf');
});
</script>
</head>
<body>
<jsp:include page="/jsp/session/menu.jsp"></jsp:include>
<!-- end #menu -->
<div id="page">
VIEW MESSAGE
<hr size="7" align="left" width="100%" color="#566316">
<span style="color: red"><%=myMessage %></span>
<%}
%>
<div class="entry">
<div id="content" class="messages">
<table cellpadding="0" cellspacing="0" border="0" align="left" class="display" id="example2" width="140%">
<thead>
<tr>
<th>SR NO.</th>
<th>Message</th>
<th>Posted By</th>
<th>Date</th>
<th>Priority</th>
</tr>
</thead>
<tbody>
<%
<tr class="separating_line">
<td class="center" style="width: 4%" align="center">data1</td>
<td style="width: 70%" valign="top" align="left">data2</td>
<td class="center" style="width: 15%" align="center">data3</td>
<td class="center" style="width: 35%" align="center">data4 </td>
<td class="center" style="width: 15%" align="center">data5 </td>
</tr>
</tbody>
<tfoot>
<tr>
<th></th>
<th></th>
<th></th>
<th></th>
<th></th>
</tr>
</tfoot>
</table>
<button id="button3" name="button3" type="button">Import PDF</button>
</div>
<!-- end #content -->
</div>
<script type='text/javascript' charset='utf-8' src='/ias/js/shCore.js'></script>
<div style="clear: both;"> </div>
</div>
<!-- end #page -->
<jsp:include page="/jsp/footer.jsp"></jsp:include>
<!-- end #footer -->
</body>
</html>
Have you included all jsPDF lib files?
<script type="text/javascript" src="jspdf.js"></script>
<script type="text/javascript" src="./libs/FileSaver.js/FileSaver.js"></script>
<script type="text/javascript" src="./libs/Blob.js/Blob.js"></script>
<script type="text/javascript" src="./libs/Blob.js/BlobBuilder.js"></script>
<script type="text/javascript" src="./libs/Deflate/deflate.js"></script>
<script type="text/javascript" src="./libs/Deflate/adler32cs.js"></script>
I'm using Dojo 1.6.1 on JSP pages.
<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'">
.........
contents of 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>
When deployed, I get javascript error.
Could not load class 'dijit/layout/ContentPane'
when inspected with firebug.
Seems that dijit.layout.ContentPane is not in the classpath. Try to add it or try to change the require for a define to see if fix.
Here is the example.