Hey VJ,
You are getting value in x1 because when on server side your fmt tag was parsed and in that you have specified dialog.close as key which is present in Application files.
In second case when your fmt tag was parsed there is key with value as
temp and not as
dilaog.close.
This is just the simple execution case of javascript because value in temp will be filled when you
jsp will be rendered on browser and not on server side.
I hope i have clarified your doubt !!!
Cheers !!!
Sumit Malik