if u havea .class file ,how can u say whether it is servlet
or not ,dont use java decompliler

Answers were Sorted based on User's Feedback



if u havea .class file ,how can u say whether it is servlet or not ,dont use java decompliler..

Answer / kunal

Just Use Reflection to get its SuperClass. If this super
class is Any of Servlet class like HttpServlet or
GenericServlet then this class is a servlet...

Is This Answer Correct ?    7 Yes 0 No

if u havea .class file ,how can u say whether it is servlet or not ,dont use java decompliler..

Answer / mamta

when we open .class file if it contain
javax/servlet/Servlet ,javax/servlet/http/HttpServlet
this shows it is a servlet

Is This Answer Correct ?    4 Yes 1 No

if u havea .class file ,how can u say whether it is servlet or not ,dont use java decompliler..

Answer / amitasite

1) Use Reflection API
2) Configure web.xml and configure <servlet> and <servlet-
mapping>. Send request to the URL. If it is not servlet
then will throw exception like
javax.servlet.ServletException: Class
com.request.TestServlet is not a Servlet

Is This Answer Correct ?    1 Yes 0 No

if u havea .class file ,how can u say whether it is servlet or not ,dont use java decompliler..

Answer / reddy

when we open the .class file
it my contains something like
;Ljavax/servlet/http/HttpServletRequest;Ljavax/servlet/http/
HttpServletRespons

where as simple java .class file will not contain this

Is This Answer Correct ?    1 Yes 1 No

Post New Answer

More Servlets Interview Questions

What are the kinds of http requests?

0 Answers  


why we should override only no-agrs init() method.

0 Answers  


i have class files in class folder. but i have no java files. but i want to modify the java files which are related to class files . how ?

5 Answers   TCS,


How ThreadSafe page attribute will be working in Servlet as well as in JSP?Automatically ThresdSafe is true in JSP so service method will be destroy in each and every request or not?so how thresd will handle srevice method?

1 Answers   AZTEC,


When Servlet is unloaded?

0 Answers  


What is the capacity the doget can send to the server?

0 Answers  


I Have A Plan to develop a Project in Struts,I want the template of struts project with Hibernate.Canany body provide me the required information?

0 Answers   IBM,


what is the difference between?when we write the code in following manner? class One extends httpservlet { } and class One extends genericservlet { }

4 Answers  


How can a servlet be used to generate plain text instead of html?

0 Answers  


Why do we have servlet filters?

0 Answers  


How is a servlet implemented in code?

0 Answers  


Define the lifecycle for executing a jsp page.

0 Answers  


Categories