Amit Ghai

Ranch Hand
+ Follow
since Mar 24, 2004
Merit badge: grant badges
For More
Cows and Likes
Cows
Total received
0
In last 30 days
0
Total given
0
Likes
Total received
0
Received in last 30 days
0
Total given
0
Given in last 30 days
0
Forums and Threads
Scavenger Hunt
expand Ranch Hand Scavenger Hunt
expand Greenhorn Scavenger Hunt

Recent posts by Amit Ghai

Hi All,

I have an icon for excel download on a jsp page. On clicking the icon I disable the icon and a request is made to a struts action to create an excel using HSSF. The content disposition is set as attachment with a filename and the bytes of the HSSFWorkbook is written to the response. The action forward returned is null. I want to enable the icon once the struts action has performed the creation and writing bytes to response. Is there a way to inform the jsp with the icon that the request for the excel generation has been completed and a dialog box has been opened for save/open excel? I need this so as to enable back the icon.

Thanks,
Amit
16 years ago
The string returned by new String() has a value of empty string ("") and not null.

I missed the point on operator precedence. This SCJP preparation is killing me

http://java.sun.com/docs/books/tutorial/java/nutsandbolts/operators.html

Thanks for the reply.
Hi All,

I have the following two code snippet.

A)
B)

A gives 'Value of i : 1'
B gives 'Value of i : 2'
For A the first condition before || evaluates to true and hence short circuits the whole expression. But the short circuit does not happen for B where first condition before && evaluates to false. Please explain.

Thanks in advance,
Amit
[ December 26, 2007: Message edited by: Amit Ghai ]
The application is being built for an elite class of users. We can safely assume that the OS is windows and browser is IE as this is the desired configuration for end user.
I would like to know in javascript, whether the taskbar is positioned at left/right/top/bottom so as to reposition the maximized window. The window is maximized so that the browser back/forward button is not visible to the end user. We have ajax calls and the back/forward can mess up things.
The only issue im facing right now is that although I get the available screen height and width left after the space taken by taskbar(using screen.availableHeight and screen.availableWidth), but the position of the taskbar is not known. Hence if I position it at 0,0 I cover only the bottom and the right positioning of the taskbar. In case the taskbar is at the top or left position, a part of the application gets hidden behind the task bar.

Please suggest. Thanks in advance.
I would like to determine the location/position of taskbar to position my maximized window. I have been able to get the width and height available in IE using the sceen.availHeight and sceen.availWidth. I would like to position the window relative to the position of taskbar. Please suggest if there is a way to determine the location of taskbar in javascript in IE.
Change the following line of your java code

req.setAttribute("ad",admin);

TO

req.setAttribute("admin", admin);
17 years ago
Extract from Java Doc over Runnable - Runnable provides the means for a class to be active while not subclassing Thread. A class that implements
Runnable can run without subclassing Thread by instantiating a Thread instance and passing itself in as the target. In most cases, the Runnable interface should be used if you are only planning to override the run()method and no other Thread methods.
You're trying to type cast a superclass object to it's sub class type...!
Is this in one file? What's the name of the Java File?
Can you post your ZipcodeGenerator servlet.
17 years ago
This is what the JLS says

'Exceptions are represented by instances of the class Throwable and instances of its subclasses. These classes are, collectively, the exception classes.'
The associated ActionForm should have getter and setter for the username and password field. Hope you wanted to know this. Your question is not very clear..
17 years ago