Win a copy of TDD for a Shopping Website LiveProject this week in the Testing forum!

Lavanya Mothilal

Ranch Hand
+ Follow
since Dec 27, 2007
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 Lavanya Mothilal

So, there is no advantage of calling System.gc method. Right?
11 years ago
Whatever I told was right only. But that was not the answer. Correct ? The question is not "what does System.gc do". Rather the question is what is the purpose of calling the method when it doesn't guarantee GC.
11 years ago
I only knew that it can suggests the garbage collector to run. So I couldn't give a solid convincing answer. Please help.
11 years ago
Hi,

This is a question I was asked in an interview. What is the purpose of calling System.gc method when it cannot force garbage collection to happen? That is, why should we call this method when it doesn't guarantee the garbage collection? What is the advantage we get in calling this method ? Please let me know if you know the answer.

Thanks,
Lavanya
11 years ago
Hi !

I have completed SCJP and SCWCD few months back. Which certification is best to take up next ? My choices are SCBCD or SCDJWS. I am completely a newbie to both EJBs and WebServices. So I am not sure which one to take up next. Please provide your valuable suggestions !
Hi !

I have completed SCJP and SCWCD few months back. Which certification is best to take up next ? My choices are SCBCD or SCDJWS. I am completely a newbie to both EJBs and WebServices. So I am not sure which one to take up next. Please provide your valuable suggestions !

ya sorry it was done by mistake.
13 years ago
Hi,

I am using an image with an <a> tag (like the one below) to submit a form with the help of javascript.



After the form submits using the "deletedetails" method, some times the action is called twice which leads to some undesired results (like trying to delete an already deleted record from a database). As I mentioned, this behaviour is not consistent and at times the action is called only once as desired.

Anyone know the reason behind this ?
13 years ago
Hi,

I am using an image with an <a> tag (like the one below) to submit a form with the help of javascript.



After the form submits using the "deletedetails" method, some times the action is called twice which leads to some undesired results (like deleting the same record twice from a database). As I mentioned, this behaviour is not consistent and at times the action is called only once as desired.

Anyone know the reason behind this ?
13 years ago
Thanks Tanveer. But this code doesn't work.

String fileName = myFile.getFileName();
File fileToCreate = new File(fileName);
if (fileToCreate.exists()) {



- This if condition always return false even if the file actually exists. I think this is because the fileName resolves only to the file's name and not its actual path. Any other idea?
13 years ago
Hi Tanveer Chowdry,
You are right. The user can use the "Browse" button to choose the existing file. But there is a provision for the user to directly type in the location of the file in the text box. The user can type location (even non existent file location). So I need to include a check for whether the file exists.
13 years ago
Thanks for your reply.

Yes Now I use the FormFile to upload. Even in this FormFile, I am not able to check the existence of the file. Have given my sample code below.
FileUploadForm fileUploadForm = (FileUploadForm) form;
FormFile file = fileUploadForm.getFile();
/**Here I would like to include the check to verify the existence of the file **/

String filePath = "Network path to upload the file";
if(!fileName.equals("")){
File fileToCreate = new File(filePath, fileName);
FileOutputStream fileOutStream = new FileOutputStream(fileToCreate);
fileOutStream.write(file.getFileData());
fileOutStream.flush();
fileOutStream.close();
}
13 years ago
Hi,

I am using Commons File Upload to upload a file. The problem is, the file gets uploaded even if it doesn't actually exist i.e a new empty file is uploaded (I am using a shared path for storing the uploaded files). My application has to thrown an error to the user if the file to be uploaded doesn't exist in the local system. Please let me know if you have any idea on this.
13 years ago
Hi,
Anybody knows a good article on how to use I18N feature of Log4j? Basically my appliation wants to support I18N logging.
Hi there,

I am trying to move a javascript present inside a JSP to a separate file. But the javascript doesnt work after moving because it contains some scriptlets . Is there a way which makes the javascript to work ?