Refresh Your Java - Before Java Interview
We are Agile, believe in less Documentation - Only Quick notes (Java Interview Questions) of Java/J2ee Read more....
As mentioned in one of the above
questions, DOJO is one of the popular Ajax Technologies
which enables you to
make HTTP calls Asyncronously.
Step 1:
Include DOJO libraries
(.js files)
<script
type="text/javascript"
src="<c:url
value="/includes/dojo_nav/js/
dojo-release-0.9.0/dojo/dojo.js"/>"></script>
<script
type="text/javascript"
src="<c:url
value="/includes/dojo_nav/js/
dojo-release-0.9.0/dojo/parser.js"/>"></script>
Step 2:
Write Java Script method to make a Serverside call.
function
fillContactFields() {
dojo.xhrGet(
{
url: "<c:url
value="/populateContact.do"/>",
handleAs: "json",
form:
dojo.byId("populateContactForm"),
load: function(response) {
populateSiteFields(response);
return response;
},
// The ERROR function will be called in an error case.
error: function(type, data,
evt){alert("Error");}
});
}
Step 2:
Display the result in whichever way to want.
//function populateContactFields(type, data, evt) {
function populateSiteFields(data) {
var contactId, address1, address2,
city, state, zip, contactName, siteTenantType;
contactId =
document.forms[0].contactId;
contactId.value =
"0";
if (data.contactId) {
contactId.value =
data.contactId;
}
address1 =
document.getElementById("address1");
address1.value =
"";
if
(data.address1) {
address1.value = data.address1;
}
address2 =
document.getElementById("address2");
address2.value =
"";
if
(data.address2) {
address2.value = data.address2;
}
city =
document.getElementById("city");
city.value =
"";
if
(data.city) {
city.value = data.city;
}
state =
document.getElementById("state");
state.vaue =
"";
if
(data.state) {
state.value = data.state;
}
zip =
document.getElementById("zip");
zip.value =
"";
if
(data.zip) {
zip.value = data.zip;
}
siteName =
document.getElementById("siteName");
siteName.value =
"";
if
(data.siteName) {
siteName.value = data.siteName;
}
}
This Portal is intended to put all Java/J2ee related topics at one single place for quick referance, not only Technical , but also the Project Management Related thing such as Development Process methodoogies build process, unit testing etc.,
This Portal has More than 500 Java Interview Questions (also could be Considered as Quick Notes) very neatly separated topic by topic with simple diagrams which makes you easily understandable. Importantly these are from our Realtime expericance.