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 do you mean by session tracking?

0 Answers  


What methods do we use in Servlet to Applet communication?

3 Answers   Infosys,


What is the use of httpservletresponsewrapper?

0 Answers  


What is generic servlet class?

0 Answers  


Why should we go for interservlet communication?

2 Answers  






What do you mean by session tracking and also explain its techniques?

0 Answers  


What is the difference between jsp and servlet life cycle?

0 Answers  


what is the difference between servlets and struts?

3 Answers  


Does servlet have main method?

0 Answers  


what is a session object?

2 Answers  


How threads are implemented in servlets?

3 Answers  


How many ways to remove the session object in the container

6 Answers   Bosch,


Categories