Wednesday, October 10, 2007

FTP to server from Command prompt

Learning to FTP a file to your server from command prompt

From start--> run --> cmd

cd to the folder where you have the file to transfer from (from your local)

type in ftp

here ftp cmc452432

type in user id and pwd

cd to the folder where you want to copy

type bin <>

type put

you are done.. =)

FTP is complete

Screen shot

Wednesday, October 3, 2007

Wanna know traffic to your website..

sooo cool.. just type in any web address and u can see the # of hits in last 3 mo to 1 yr

http://www.alexa.com/data/details/traffic_details

Enter : listentosonu.blogspot.com

Tuesday, September 11, 2007

Struts Html Drop Downs n JS

Long time for me make the struts drop down work..

I basicaly need 3 standard values in my drop down..
1) select ""
2) long term
3) short term


Here is the html code:


Select...
Short Term - less than or equal to 180 days
Long Term - more than 180 days


Value from the form(sArcfacilityGradeForm.facilityTenorValue) is preselected in the dropdown

Here is the JS Function:

function tenorChange(tenroObj){
var tenor=tenroObj.value;
alert('Changing tenor on screen');
alert('tenor value read from screen is :'+tenor);
//document.forms[0].tenor.value=tenor;
//alert('display tenor value from form'+tenorScrenn);
if (tenor == "") {
alert('Please select a valid tenor');
tenroObj.value=document.forms[0].facilityTenorValue.value;
return false;
}
document.forms[0].tenorScreenValue.value=tenor;

//document.forms[0].facilityTenorValue=tenorScrenn;
document.forms[0].action.value = "changeTenor";
document.forms[0].submit();
}

Input: tenroObj is dropdown object used to display on the screen.
var tenor=tenroObj.value; ==> will contain the value selected
ex: From Short Term - less than or equal to 180 days
if short term -less than or equal to 180 days is selected on the screen, this value contains: 179.


You can only set String values from JS to Form. So here,
tenorScreenValue: Has to be a String value in the Facility Grade Form.

document.forms[0].tenorScreenValue.value=tenor;

Very Important Note: Form values you are trying to set from Java Script must be defined as hidden variables in the JSP or JS wont be able to read them

Ex:

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