Hari Gangadharan

Ranch Hand
+ Follow
since Mar 08, 2001
Merit badge: grant badges
For More
Cows and Likes
Cows
Total received
In last 30 days
0
Forums and Threads

Recent posts by Hari Gangadharan

Not enough information - may be you should tell us what you are doing in the thread.

Read more about your issue here
19 years ago
Can you tell me what is in line 73 of OnlineStoreServlet.java??
19 years ago
First you should think whether you need to use a single Servlet as a controller for many JSP pages. May be a subclass of the controller should handle that? Or you should look into the possibility of using an MVC framework like Struts or JSF.

If you really want to use a single controller for multiple JSP pages creating hardcoded dependencies, you can find the referring page by:
String myReferer = request.getHeader("referer");

Later you can use the myReferer to chain the response URL. Hope this helps.

Note: Your name does not seem to be following the naming policy. JavaRanch has a naming policy, which is strictly enforced. Please read the policy and change your display name if you wish to continue posting here.

You can change your name: here
[ March 01, 2005: Message edited by: Hari Gangadharan ]
19 years ago
From my experience the laws gets triggered when you quit. They cannot do anything if you refuse to work citing sickness, illness of your immediate family members or problems with the work environment. If the company you are joining does not require a letter confirming termination of employment, the best thing to do is sent a month's request of leave citing your "carpel tunnel" issues. There are no laws in most of the world to force you to work (unless you are in armed forces). Hence you can go on extending your leave of absence until they fire you or you are out of the contract. For less than a dollar you can get all kinds of medical certificates.

I had a $10,000 contract with my old employer - their contract was one sided too and this is considered as the cost of my training and the cost of replacement. Eventhough I was working in California, the company was located in Michigan and has kept the governing law as the law of Michigan (which obvously was worse than CA laws). I quit the company 3 months before the end of contract. They sent me a letter asking for $10,000 and sent it to collection. I was really scared and I tried to negotiate with them. I would have settled it for $3000 and I thought they will, but the company came back and told me that I should pay the full amount. Very nice of them that they gave me an option to pay this in 6 equal interest-free installments :-). They also sent to INS a nasty letter telling that I am out of status and I have not completed my obligations to them and the *US* goverment! I ignored everything - A collection company tried to call me couple of times. I never answered but I think they could not get a judgement against me. Few months later I checked my credit history and it was fine.
20 years ago
I have some web services deployed at my workplace -- I am thinking of creating automated test scripts for this. A group in my company is creating a company-wide test suite but I heard they are a not ready right now. There are no testing standards within the company right now. Hence I am interested in know what are my options and which one may be the best one. Suggestions, comments are welcome.
20 years ago
I guess you are somehow missing the arguments - maybe it is the fault of the JVM. What I can suggest is to create a program and run that with the same arguments -- it would be easy if it is Unix. You can write a small shell program say test.ksh with the following lines of code:
<code>
#!/usr/bin/bash

echo "Argument Count: $#" >/tmp/xyz
echo "Arguments: $*" >> /tmp/xyz
</code>
Execute "bash test.ksh" followed by your arguments using your Java program and take a look at the /tmp/xyz file. If the arguments did not come through properly, you may need some adjustments. This definitely will give you a hint.

I would also recommend passing the parameter as an array (the other exec method).
20 years ago
My guess is your application, or one of the APIs you are using is creating a thread which is not finishing on System.exit(0) call. Hence your application is waiting for the other thread to die.

Sometimes developers code the stopping of threads in the finalize methods and the finalize method may not be invoked on termination in some Java VM implementations (it is not necessary to invoke finalize before a VM is terminated). Maybe the Windows implementation invokes the finalize method of all the objects before termination and the Solaris Java VM is not doing that. Hence a thread might have not killed itself and kept the application hung.

My advise is to look for the threads that are started in this application and make sure that you make explicit calls to stop them before you call the System.exit(0).
[ June 28, 2004: Message edited by: Hari Gangadharan ]
20 years ago
Yep. It is safe as long as it is an array of primitive datatypes.
20 years ago
The Security Filter (http://securityfilter.sourceforge.net/) can handle most of your needs. Take a look at there website. It is an open-source project.
20 years ago
I have used 3 different IDEs - I am satisfied with Eclipse and stopped trying other IDEs. It is a little slow to start-up but I can't think of using any other IDE. It can satisfy a big user base. I would suggest that you use couple of IDEs and decide based on that.
My employer uses IBM Websphere Studio Application Developer (WSAD) which is a commercial version of eclipse. I use eclipse at home so it works out well for me.
Hope this helps.
[ March 28, 2004: Message edited by: Hari Gangadharan ]
20 years ago
Hi Girish -
Tim has explained it very well. But in more lay man terms let me add a little more.
1. The switch you are talking about is most probabily a router. If you have more than 1 computer sharing the internet then there is a very good chance that it is indeed a router.
2. First thing first - check whether your LAN card is setup correctly. You can check it in the Network settings. I am an old school guy and I would like to look at the /etc/sysconfig/network-scripts/ifcfg-eth0. Also you can verify this while booting the server - make sure that eth0 startup comes back OK. If you do not see "Starting eth0" then your card is not configured.
3. Once you have determined that the eth0 is working properly, check the IP address you are using for that. Did you make it DHCP or static. Normally a Linux server is assigned a static IP. You can first ping the IP address of another server in your domain. If ping comes back OK then your LAN setup is OK.
4. You might have not given the correct gateway address. Your server need to know how the packages are to be routed. Gateway address will be the IP address for your router. Once you set the gateway IP, you can do a test by pinging 66.218.71.198 (yahoo.com) or 208.185.179.12 (apache.org). If one of the ping has answer then you are connected to internet. If not, look under gateway address in the network settings.
5. Now try pinging yahoo.com or apache.org (name - not IP). If ping works, then you are ready to roll. You should now be able to access Internet. If ping fails, then you have not defined the DNS servers. Define it in the network settings. If you do not know the DNS server IP, contact your ISP or look at their web site.
[ June 27, 2003: Message edited by: Hari Gangadharan ]
21 years ago
Java ensures that the files are closed on exit. In the current case the BufferedWriter wraps your FileWriter. BufferedWriter's default behaviour is to flush the buffer to file once in a while. So if you are using a buffered file writer and if you do not explicitly call flush then there is chance that some of the stuff written is not physically written to disk. You can experience this when you are writing huge files (the last chunk may be missing). So I would assume that the first time it happened because the buffered writer flush executed before the file writer is closed.
21 years ago
Cyber01,
You are not respecting the Javaranch's official policy on displayed name. You have to change your display name to "Firstname Lastname" as described here:
http://www.javaranch.com/name.jsp
[ February 11, 2003: Message edited by: Hari Gangadharan ]
21 years ago
Hi -
RPM stands for Red Hat Package Manager. If you double click the .bin icon then it will inflate and create another .rpm file. You have to install that running rpm -ivh filename. I do not know whether double clicking the .rpm works.
Now you can create a java source code anywhere you like. The best place may be a sub directory under your home. If your class name is MyClass then you may have to create it in MyClass.java file. You can create the source using any plain text editor - Emacs, Vi, Jedit, Jext.. or even some IDEs like Eclipse ( http://www.eclipse.org ) or JBuilder ( http://www.borland.com ). I would advise you to use some simple text editors until you are familiar with all the aspects of Java. Once you are confident, you can switch to an IDE. An IDE can reduce the typing you need to do.
Now using java thru terminal you need to compile your java program:

cd ~
(This will take you to your home directory)
cd javasrc
(this is where you created the Java code)
now do
javac MyClass.java
(a file MyClass.class will be created)
now do
java Myclass
Hope this helps.
[ February 11, 2003: Message edited by: Hari Gangadharan ]
21 years ago
According to my experience, it is better to create a new one. Some people may say that the construction of a new object may degrade the performance. I write batch Java programs that goes against millions of records. I have not seen any significant preformance differences by creating a new object instead of reusing the objects. I have not done any performance evaluation on StringBuffer, but have done some using some other classes.
21 years ago