Manish Malik

Greenhorn
+ Follow
since Jan 27, 2001
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 Manish Malik

Hi,

If a web service running on Axis/Tomcat, how would the web service load some preconfigured values from a .properties file?

For example, if the web service's Implementation class needs to access some stored key-value pairs from a .properties file, where should this file be placed?

For example,

FileInputStream myPropertiesFile = new FileInputStream("myconfig");
Properties myProperties = new Properties();
myProperties.load(myPropertiesFile);
// access properties from the object here...
myPropertiesFile.close();


Where should this file be placed (for example, in case of tomcat) for the web service to be able to read it?


Thanks.
18 years ago
Hi,

How does a web container (like tomcat) handle .properties files for access by servlets?

For example, if a servlet needs to access some stored key-value pairs from a .properties file, where should this file be placed?

For example,

FileInputStream myPropertiesFile = new FileInputStream("myconfig");
Properties myProperties = new Properties();
myProperties.load(myPropertiesFile);
// access properties from the object here...
myPropertiesFile.close();


Where should this file be placed (for example, in case of tomcat) for the servlet to be able to read it?

Does the location change, if the class that needs to access the properties file is a web service? (Axis under tomcat)


Thanks.
18 years ago
Hi,

How does one generate a new Windows GUID from within Java?

I have been looking at the API available in .NET for this, and it involves a call to System.Guid.NewGuid() to get a new GUID generated. Does Java offer something similar for Windows environment?

Thanks.
18 years ago

Originally posted by luc comeau:
now say if i construct this class with TestComparator(true),how exactly am i to use that input value of true to make sure the list sorts in descending order?I kindof get the idea that i would say somewhere in my compare method
if(descending)
then..somehow make sure it sorts in descending order...but i duno how to do this.



If you check the Java Documentation for

Comparable Interface and the description of compareTo method there, you'll see that the way sort is done depends upon the return value of the compareTo method.

Reverse the return value (positive <-> negative) based upon the boolean flag passed in the constructor, and experiment this way forward.
18 years ago
So what was the problem?
18 years ago
Reading about Serializable interface is recommended.

In a nutshell, the class 'Add' should implement the above interface for the programmer to be able to serialize its state. You wouldn't need to add another method to the class; declaring that the class 'Add' implements the Serializable interface should work. (hint: see the usage of Java keyword 'implements')
18 years ago
Or you could write a program to generate and populate the database with million records having random data.

Originally posted by Paul Keohan:
I'm not sure but I'd say it's because you're using Byte as the incoming parameter type in the method. The initial variable is a byte, not a Byte. There is nothing in Java to automatically cast a byte type to a Byte object.


Thanks. :-)


------------------
Manish.
22 years ago
Hi,
please have a look over the following code, and tell me why the Byte type variable is also being upgraded to Float type while calling as a function argument? The Integer variable is understandably upgraded to Float, but why Byte, even when the definition of function with Byte argument is available?



------------------
Manish.
22 years ago

Which sorting algorithm does sort() function use?
23 years ago

Most of the programs I have seen, which require user input, read it from the command line.
What is the method equivalent to C++'s cin or scanf(), so that user can interactively input values in a console Java program?
Is this method too tedious to implement that most programs resort to command line?

------------------
Manish.
23 years ago

Originally posted by Carl Trusiak:
One thing is the removal of pointers, This helps prevent the exceptions that occur due to improper amangement of them.


Does this also pose difficulty in implementing some thing that could have been done quite simply in C++ ?

------------------
Manish.
23 years ago

Originally posted by Cindy Glass:
Well, it took some poking around, but I finally found this fascinating disertation on the Lexical Structure of the Java Language.
http://java.sun.com/docs/books/jls/second_edition/html/lexical.doc.html


Thanks for the link. Will be reading it and posting if I have any further doubts on this topic.


------------------
Manish.
23 years ago
Sorry this is not to reply to your question, but to suggest that next time if you put the subject line in such a way that it includes/indicates what your message is all about, you can get many more meaningful responses.
Thanks.

------------------
Manish.
[This message has been edited by Manish Malik (edited January 29, 2001).]
23 years ago

Originally posted by Cindy Glass:
Post the code that you used to play with the unicode.


You can take the example of simply using the statement:
System.Out.println(arg[1]);
where arg[1] represents a command line agrument. If you put in an extended ASCII character here, it will not display it correctly (at least on my system).

------------------
Manish.
23 years ago