jeya velan

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

Recent posts by jeya velan

thread.run();


The above is like calling a method on object.It is executed in the same call stack.Does not create new thread.

thread.start();


Calling start() actually creates new Thread of execution.

If you add the above SOP to your run method you can see what happens.
Are you getting any exception.

# Statement s = connection.createStatement();
#
# s.executeQuery (sql);
#
# rs = s.getResultSet();
#
#
#
# String bid = rs.getString("bus_id");


I think rs.next() is required before running any getters on the result set.
13 years ago
JSP

Anuj Batra wrote:
function logout() {
<%session.inValidate();%>
}



You can not make a javascript function to execute a scriptlet.
You can call the logout URL using javscript which will do the work.
But you can't be sure.
There is no guarntee that onunload will execute properly.
13 years ago
JSP
Good response..
I ran the following JSP to check this.

The output is:
[one, two, three, four]
null

In the code above even after changing the arrayList point to null, the list in the session displays four values.
But if we call the setter again the value in the session changes to null.
Changes done on the reference reflects in the list stored in the session.
But changing the reference to null not reflecting.
I don't know why.Can you help.
Thanks in advance.
13 years ago
Do not understand what your problem is.
If getting the generated PK is the problem, than you can use the below code if you are using Prepared Statement and
your database supports identity columns
13 years ago
According to your code are you seeing this java script alert "In ready state ".
If it is yes Put a alert for request.responseText and see what it displays.
One of thing you can try is by changing the Content type in the servlet to text/plain.
13 years ago

munjal upadhyay wrote:

jeya velan wrote:When the container receives the first request, It will create an instance of the servlet.
Then it will call the init method which does the intializtion process.
Then it starts to service the request.
Then for the subsequent requests, A thread will be created per request which executes the service method in its own stack.
At any time there will be only one instance of a particular servlet in the memory per JVM.

If you preload your servlet, than creating and initializing will be completed at the server start up time itself.



the initialization and init() is different

initilization :- the constructor part of the servlet class is done , and the ordinary object of that class is created
init() :- the ordinary object --> servlet object , and servlet object has all the writed like accessing the container data etc...

I had read this in headFirst servlet and Jsp .
so
your statement :- Then it will call the init method which does the intializtion process.
is not conviscing.

will you please please rewite it

thanks in advanced.


You can reword it to The container will call the init method which transforms the POJO to real servlet
13 years ago
When the container receives the first request, It will create an instance of the servlet.
Then the container will call the init method which does the intializtion process.
Then it starts to service the request.
Then for the subsequent requests, A thread will be created per request which executes the service method in its own stack.
At any time there will be only one instance of a particular servlet in the memory per JVM.

If you preload your servlet, than creating and initializing will be completed at the server start up time itself.
13 years ago