Yuma Shankar

Greenhorn
+ Follow
since Jun 07, 2005
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 Yuma Shankar

Thanks a lot. I will look into both the options suggested-the listener and making the connection pooling container based.
18 years ago
We have a development environment running TomCat (within Eclipse).

We use a connection pool. And everytime we build our app, the context reloads and if we have any existing connections at that point, they do not get cleared up or reused. So, the only way to clear them up right now is to restart TomCat.

As a work around, I was looking into implementing a Context Interceptor where I could put the connection clean up code in the context reload method. I find that TomCat 3 had a BaseInterceptor class in org.apache.tomcat.core. But, I cannot find any Interceptor classes to extend in TomCat5.

Any ideas?

Thanks
18 years ago
You are right. That is exactly what I told my colleague-"small amount of code" is a poor excuse. And come on,if just including the license comments is a pain, even breathing is I guess!
18 years ago
I just had a conversation with a team member about adding the license agreement to a couple utility methods that he had copied from an Open Source API. He is arguing that since he is using only a couple methods and not the entire API, he did not see why he should include the license. Well, I replied back saying that say in a research paper, when quoting a few lines from a book, you do include the reference, so what is different here? He still insists it is overkill. Thoughts please?

Thanks
18 years ago
The webapp is processing a data file on the users hard drive and then writing to an error file on the drive. So the hyperlink is for the user to open that error file.


Thanks
18 years ago
JSP
I have a JSP page where I am providing a hyperlink to a file on the C: drive as follows

<a href="C:\ReqImport\data.txt" target=_blank >Try this </a>

Nothing happens when I click this hyperlink.

When I scroll over the hyperlink I see the correct path "file:///C:/ReqImport/data.txt" in the status bar and when paste this path in my address bar, it does open up the file.

Any ideas why this file hyperlink does not work on this JSP page.

Thanks
18 years ago
JSP
I am actually considering just making the utility class a class with static functions.
18 years ago
We have many Database Access Classes (D1, D2, D3...) for each table in our application. All of these classes need to access some common functions such as getConnection and getResultSet.

I suggested keeping these functions in a separate Utility Class. The concern in the team is if we do so we will instantiate several objects of the Utility class as all D1, D2, D3 etc. will access these.

Another team member suggested that we should have a baseclass DBase for all the Database Access classes i.e. have D1, D2,D3 extend DBase and that will allow us to access the common functions and we will avoid creating several instances as in the case of the Utility class.

I find it odd that we should use inheritance in this manner where there is really no "is-a" relationship whatsoever betwen the base class and the derived classes!

Is my concern valid and Can someone come up with any other alternatives?
18 years ago
I just configured Eclipse 3.0 with Tomcat 5.5 using the Sysdeo plugin. And I am able to run jsp pages, but I am unable to run servlets.

Tomcat restart log also dispalys the following error:
SEVERE: Error configuring application listener of class listeners.SessionListener

I created a TomCat project with the default options i.e. update server.xml and use default directory structure.

I also copied the sample web.xml file and changed the <servlet> and <servlet-mapping> tags . I kept the listener tag the same as in the example i.e.

<listener>
<listener-class>listeners.ContextListener</listener-class>
</listener>
<listener>
<listener-class>listeners.SessionListener</listener-class>
</listener>



Any help is appreciated!
18 years ago
Thanks guys and sorry about the post. On further debugging, I find that the problem is elsewhere.

Thanks
18 years ago
You are right. It is local, but it is a return parameter. Below is the complete example with the return statement. - Thanks


public synchronized ArrayList getRecords(String className, String structure,
String condition)
{
ArrayList a = new ArrayList();

Object recordData,retval;

rs = getData(structure, condition, "query");
while (rs.next())
{ a.add(recordData);

return a;
}
}
18 years ago
I have a situation where there is method that creates an ArrayList and populates the ArrayList with data from a database resultset. The application in question is a multithreaded application. Hence, when two users(threads) access this same method, the arraylist elements are getting out of wack-of course -since ArrayList is not synchronized. When I synchronize the method, it still does not help with the ArrayList even though the arraylist is local to the method. I do not understand that... Since by synchronizing I have a lock on the method, why does a object(the arraylist)local to the method not adhere to the lock?
Example below

public ArrayList getRecords(String className, String structure,
String condition)
{
ArrayList a = new ArrayList();

Object recordData,retval;

rs = getData(structure, condition, "query");
while (rs.next())
{ a.add(recordData);
}
}
18 years ago
I am sorry, but I guess I should actually be posting this in the Java Forum. Will post it there...
18 years ago
JSP
public synchronized ArrayList getRecords(String className, String structure,
String condition)
{
ArrayList a = new ArrayList();

Object recordData,retval;

rs = getData(structure, condition, "query");
while (rs.next())
{ a.add(recordData);
}
}
18 years ago
JSP