Win a copy of Spring Boot in Practice this week in the Spring forum!

ashok khetan

Ranch Hand
+ Follow
since Jul 29, 2001
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 ashok khetan

Hi,

I am checking if the logged on user is present in database using a static method. This method will be called by all jsp pages before showing any data.

I want to know - will there be any issues if multiple users are accessing various jsp pages and this method gets called simultaneously?

Thanks,
Ashok


Hi, can somebody help on this please?

Thanks....
13 years ago
You need to set the 'mail.jar' file path (e.g. c:\mydir\mail.jar) in your classpath. Still if this doesn't work, download mail.jar from sun site and replace the one on your machine..
13 years ago
Hi,

I have an application, which sends email to multiple users with different email body for each user.

I am calling the following function in a loop:



On an average, the program sends around 25 emails and all emails are delivered successfully, without any delay. But the LAN administrator complained that my program is sending a large number of UDP packets to all the users on the LAN, and thus clogging the network.

Any idea what could be the possible reason for this? It's strange since all the emails are received without any issues. Any way to make this program more efficient?

Your help very much appreciated...

Thanks,
Ashok
13 years ago
Since this is a webservice method, i have to use stateless session bean only. But is there any possibility that the container may call the private method on a new instance when invoked from the public method?
Yes, stateful session bean can be an option. But i am using stateless session bean because my bean will be having only one public method which is called by the client....multiple method calls (to private methods) happens only from the public method.....

My question is that, is it possible that when i call the private method from the public method, the container may create a new bean instance and then invoke the private method on this new instance?
Hi All:

My session bean code looks like this:

public class TestBean implements SessionBean {
private Connection con;

private String privMethod() {
PreparedStatement pstmt = con.prepareStatement("select * from table");
ResultSet rs = pstmt.executeQuery();
while(rs.next()) {
------
}
return "1";
}

public void pubMethod() {
con = DBCon.getConnection(); // con defined as class member
String s = privMethod();
con.close();
}
}

When I call the public method, the connection created there is available to all the private methods called from there becoz the reference is declared at class level....we can access this bean only through it's public method, I mean there is no other invocation point....

So can i be sure that when the public method calls the private method, the container will call the private method on the same bean instance which is used for the public method? Here if the private method is invoked on a new instance then the connection object (con) will be null in the private method which is not desired.

Thank you,
Ashok.
congrats!!! Nice score....u deserve it!!
ashok
congrats!! excellent score!!
wish u all the best for ur future endeavors.
ashok
hi! thanks all for ur wishes.....And Leena! welcome nice to see u back.Enjoy it!!!
code based questions means questions with practical code but not more than 40 lines:-)
thanks
ashok.
Hi!
With ur wishes i cleared the test with 91% today...It wasn't too easy but not very hard either....I too got questions on design patterns other than mentioned in the exam objectives...got nearly ten code-based questions......I didn't get any questions on filters...DD questions were quite simple..thanks to Carl and all other fellow-ranchers for their timely help, i got......Really, javaranch is great!!
thanks a lot!!
ashok
Hi!
one simple query....in the case of beans does the case of the property-name matters? e.g.
<jsp:setProperty name="obj" property='age' />
or
<jsp:setProperty name="obj" property='AGE' />
I tried it and both are working fine.So is it by default or depends on the server?
ashok.
True or False:
A servlet implements SingleThreadModel interface. The servlet container may run multiple threads on its methods.
congrats Anand!
Did u get any questions on filters?
ashok
congrats Matt! great score!
wish u all the best for ur future endeavors.
ashok
20 years ago