If you don't know how to write a JSP, it's time you picked up a book.
And for the love of everything, use some good practices.
Actually, i want to shows the different images on index page and after selecting a particular image it should show the black and white pixels from that image n the size of image but on the same page(ajax).
For this i used ajax and this servlet but from index page this servlet is not getting call in ajax. If we use jsp instead of servlet then is getting called from ajax in jsp. so I am trying to convert the given servlet to jsp.
Your servlet will get invoked only through url-mapping. Please try. also as suggested by Swastik you shouldnt use jsp for java code as it is limited to only view purposes.
thank you kesava. but i used full URL like http://localhost:8080..... but still it's not working.