Mladen Grabowsky

Greenhorn
+ Follow
since Sep 19, 2007
Merit badge: grant badges
For More
Cows and Likes
Cows
Total received
In last 30 days
0
Forums and Threads

Recent posts by Mladen Grabowsky

clone() should not be used to copy objects, use copy constructors or factory methods instead.
Are those jars being copied to the WEB-INF/lib folder?
If not, you should.
Hi ankush,

the JEE libs are missing.

My Tipp for you: Start with Java Standard Edition, not the Enterprise Edition. You wouldn't get far if you tried to learn Java by starting with JEE, all you get is frustrated.
17 years ago


or I'd say "Hey, there's no reason why null shouldn't have square brackets, too, and write

public String toString()
{
return " xxx: [" + getXXX() + "]\n";
}


I'd go with Ernest's solution, it's the fastest, but more important, it is also the simpliest.
[ October 15, 2007: Message edited by: Mladen Grabowsky ]
17 years ago
You haven't mapped the servlet.

You have to map a class to a servlet name


then that servlet name has to be mapped to an url

This is just an example, in real life you do not map servlets to the /servlets/... url.
[ October 15, 2007: Message edited by: Mladen Grabowsky ]
17 years ago

Does anyone please have some tips on whether I'm using the wrong directory or possibly have a classpath issue.


My tip: read the servlet spec.

Then add mappings for your servlet in the web.xml
17 years ago
The problem is that there is no DB selected or the wrong DB is selected.
User sa ususally has a standard schema.
You can select the DB via the connection url or create a new db user and set a standard schema for him.
Personally, if i wouldn't go for JPA/Hibernate, i'd prefer iBatis over plain JDBC.
Is sex all by yourself not considered as sex?
17 years ago

Originally posted by Joanne Neal:
And here's the
link


Excellent link Joanne, thanks!
17 years ago

Originally posted by Jim Yingst:
[MdQ]: I think you could easily write a test to see if '1' or '-1' is always returned.

True - however such a test may give misleading results. It's very common to see compareTo() methods which return only -1, 0, or 1, and therefore it's quite possible that a test will show that the method "always" returns those values. But that just means that the tester hasn't tried enough different Comparable classes. (Hint: try comparing two String values.)


Thanks for the hint Jim, it's much appreciated.

You're right, the string implementation may (and certinly will) return more values than just 1, 0 an -1.

http://java.sun.com/j2se/1.5.0/docs/api/java/lang/String.html#compareTo(java.lang.String)


....
If there is no index position at which they differ, then the shorter string lexicographically precedes the longer string. In this case, compareTo returns the difference of the lengths of the strings -- that is, the value:

this.length()-anotherString.length()



So, one should always just check, if the returned value is equal to zero, higer than zero or lower than zero.
17 years ago

before running tomcat in eclipse it was showing.
but now nor external tomcat home page is running nor eclipse's internal though on giving full path of file of any application it is perfectly fine.


eclipse has modified the server.xml of your tomcat.
Sorry to say that, but I don't think that there is a way to restore your orig. configuration.
You should not use a TC that is used for other than devevlopment purposes from within eclipse.

You can configure if eclipse should modify you installation or not in the server settings in eclipse.
17 years ago
Hi timo,

But actually it seems to me, compareTo() returns only 0, 1, -1 even if the API spec does not explicitly mention it...So I could omit the transfomation which would reduce the amount of code. But, how can I be sure?


It seems to me too

But if you really want to make sure, why not test if the returned value is:
- equal to 0
- lower than 0
- higer than zero

btw., i have never tested for that, to me, it is suficient when i treat all return values as either -1, 0 or 1
17 years ago
Hi Madhu,

apart from your problem, Tim is right, it is pointless to send multiple files in one stream, there is no way how they could be seperated by the client in a meaningful way, at least there is no way i would know about.
17 years ago

You are closing the outputstream, which flushes it, then you're trying to open it again and sending some more data through it...

open & close the outputstream outside the loop, i think you have to set the headers all at the beginning, but i could be wrong on the latter.
17 years ago