Tuesday, August 28, 2007

Setting Focus to Apt section of the page

DG page has the following:
CI
SI
RI
DG
When user changes a value in RI user shud be brought back to RI, instead of the beginning of the page where he will have to scroll into the apt section.
here is how we'll do id:

Declare div values for each section of your page and

Set the value in ur action class on pg submit

facilityGradeForm.setShowRegClass(true);
facilityGradeForm.setShowCI(false);
facilityGradeForm.setShowGuarantee(false);
facilityGradeForm.setshowOS(false);
facilityGradeForm.setShowDG(false);

Call a generic js fn on pg load to scroll into the div value on submit.
function setAptPageFocus(){

//alert("IN apt page focus");
//alert(document.forms[0].showGuarantee.value);
if (document.forms[0].showGuarantee.value=="true"){
//alert("In Show Guarantee");
divShowGuarantee.scrollIntoView();
}

if (document.forms[0].showOS.value=="true"){
//alert("In Show OS");
divShowOtherSupport.scrollIntoView();
}

if (document.forms[0].showRegClass.value=="true"){
//alert("In SHow Reg Class");
divShowRegClass.scrollIntoView();
}

if (document.forms[0].showCI.value=="true"){
//alert("In SHow CI");
divShowingCI.scrollIntoView();
}

}

Each page submit will take you to apt section of the page yay.!!

Friday, August 10, 2007

Opening a JAR, WAR or EAR file

I always wondered if I can see the contents in the mysteriously looking Jar, WAR and EAR Files. Now I know how to do the trick :))

Copy your war to a different directory, Simply rename it to war and double click it.. lol there you can see all the contents of your war file. hehe..

You can do the same trick to see EAR and WAR files.

yeppeee..!!!

Wednesday, August 8, 2007

Force Shut down your server

Had a problem today with my eclipse..where I had to close. My server continued to run though my eclipse is not open...

When I opened my eclipse. and tried to start the server, it said cannot acquire a lock on ldap etc, and was not starting.

In such cases, goto your console,

server--> control --> Force shutdown.

Exporting WAR File from Eclipse

An alternative to using Build.xml to create a war file..

RT click on the project --> export --> Java J2EE --> WAR

select your destination location

uhoooo witin like a minute you have your war file created at ur destination..and you can deploy it directly to your server...
Looks like you can also create an EAR file accordingly..Nice logic :))

ehhaaahaa