Sridhar Gudipalli

Ranch Hand
+ Follow
since Nov 02, 2005
Philadelphia, PA, USA
Cows and Likes
Cows
Total received
0
In last 30 days
0
Total given
0
Likes
Total received
2
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 Sridhar Gudipalli

Yeah.. That is the reason government is paying for the heating bill (as you know .... its US capitol building.... )
8 years ago
Thanks. Yeah, I uploaded the image into http://imageshack.us/ and linked that to profile picture.
8 years ago
I was editing my profile and observed that there is a "Picture" input box with no upload button next to it. How could anyone upload a picture to the profile? Is it a rank based privilege?
8 years ago


Cant you replace this line with below? Why are you using unnecessary font tags?





Do you always enter the "Pack Name" value as "packName"? (case insensitive). You are reading the packName value from the request and checking if the value is "packName".. Are you missing some thing here or doing this intentionally?
8 years ago


Sorry but my response is not related to your problem. But I was wondering why this method signature is like this? I mean bunch of parameters? Why dont you have a single or some less number of objects which contains these parameters? You are forcing method users to type all the parameters (I know now its private method)?

- where exactly does the servlet get loaded - into the memory, or into the container ??



As per my understanding container loads the servlets into memory.

- also what are the methods that get called on the servlet. init method gets called for sure, what about the service method ? does loading a servlet mean that the servlet gets serviced as well ?




Source: The init, service, and destroy methods are the servlet's lifecycle methods. The init method is called once by the servlet container after the servlet class has been instantiated to indicate to the servlet that it being placed into service. The init method must complete successfully before the servlet can receive any requests. A servlet programmer can override this method to write initialization code that needs to run only once, such as loading a database driver, initializing values, and so on. In other cases, this method is normally left blank.

The service method is then called by the servlet container to allow the servlet to respond to a request. The servlet container passes a javax.servlet.ServletRequest object and a javax.servlet.ServletResponse object. The ServletRequest object contains the client's HTTP request information and the ServletResponse encapsulates the servlet's response. These two objects enable you to write custom code that determines how the servlet services the client request.

The servlet container calls the destroy method before removing a servlet instance from service. This normally happens when the servlet container is shut down or when the servlet container needs some free memory. This method is called only after all threads within the servlet's service method have exited or after a timeout period has passed. After the servlet container calls destroy, it will not call the service method again on this servlet. The destroy method gives the servlet an opportunity to clean up any resources that are being held (for example, memory, file handles, and threads) and make sure that any persistent state is synchronized with the servlet's current state in memory.


- also regarding the the load on start up tag in web.xml. Can we have two servlets with load on startup value as 1 ?


Yes, <load-on-startup> tag specifies that the servlet should be loaded automatically when the web application is started. You can define the value in this tag. So multiple servlets can have this tag.
8 years ago
Personally, I suggest you to take any SCJP book. Because, it makes you think in SCJP way!!!
Did you buy this voucher from Sun/prometric centers or from anybody else? Also did you ever schedule any other exam?
Are you able to connect to the DB thru JDBC using same credentials? Also can you please modify the finally block as below?

How about iLad (International Lading..) or gLad (Global Lading..)
8 years ago
JSP
Surprising... Missing jar files caused NullPointerException? Shouldn't it cause ClassNotFoundException??

Please check "hibernate.connection.URL" in your configuration file.
When you paste the code here, select it and press the "Code" button (or also prefix with '[ code ]' and suffix with '[/code]' ). It formats the code properly and puts line numbers.

Caused by: java.sql.SQLException: Io exception: The Network Adapter could not establish the connection
..... at com.myhibernate.hp.test.EmployeeDetailsClient.main(EmployeeDetailsClient.java:33)



Please use code tags so that it is easy to look the exact line number.