Anda di halaman 1dari 10

http://www.allapplabs.com/interview_questions/servlet_interview_questions.

htm#q5
cs506 today paper
why jsp is better to asp
four explem of expressin language
different between html and jsp
how java becomes javebeans requirement write.
expression language ka quiestion .mcqs old pape

Read more at
http://vustudents.ning.com/group/cs506webdesignanddevelopment/forum/topics/cs506-all-
current-final-term-papers-fall-2015-past-final-term-1?xg_source=activity#TzxtfJKm2yFVzFjj.99

Write the name of three types of Custom Tags? (3 Marks)


Answer:- (Page 379)
Three types of can be constructed. These are:
1-Simple Tag
2-Tag with Attribute
3-Tag with Body
define these wait(), notify() .notifyAll()
Difference between static and non static inner class?
. Controller:
What is Servlet Problem generating html pages?

Read more at
http://vustudents.ning.com/group/cs506webdesignanddevelopment/forum/topics/cs506-all-
current-final-term-papers-fall-2015-past-final-term-1?xg_source=activity#TzxtfJKm2yFVzFjj.99

Why Client side Validation Good?


A bean class ___________ be serializable.
Can
Cant
Must (Page 356)
JSP action elements allow us to work with _____________.
HTML
JavaScript
JavaBeans (Page 367)
ManagedBeans
Ref :- JSP action elements allow us to work with JavaBeans
UDDI stands for
Universal Description, Discovery & Integration (UDDI) (Page 490)
Universal Data, Discovery & Integration (UDDI)
Universal Data, Database & Integration (UDDI)
None of these
Ref: - Universal Description, Discovery & Integration (UDDI), a way to publish and find web
services
Which of the following is a correct order for Bean scope in JSP page from most visible to least
visible?
application, session, request, page
page, request, session, application (Page 372)
session, page, request, application
application, session, page, request
Ref: - The scope attribute has the following possible values: page, request, sessionand
application
Which of the following is a correct order for Bean scope in JSP page from most visible to least
visible?
application, session, request, page
page, request, session, application (Page 372)
session, page, request, application
application, session, page, request
Ref: - The scope attribute has the following possible values: page, request, sessionand
application

Which of the following directory is the top level TOMCAT directory that contains all the
application deployed
on web server?
webapps (Page 260)
bin
lib
tags
Ref: - The webapps folder is the top-level Tomcat directory that contains all the web applications
deployed
on the server. Each application is deployed in a separate folder often referred as "context".
In which file do we define a servlet mapping?
Web.xml click here for detail rep
index.html
Servlet.xml
None of the given options
Ref :- The web.xml file defines each servlet and JSP page within a Web Application

RPC stands for


Remote Personal Computer (RPC)
Remote Procedure Calls (RPC). (Page 488)
Remote Procedure Client (RPC)
None of these
Ref: - In the beginning, things were built and deployed typically in the form of client and server
model in
which clients talk to a single server, for example, remote procedure calls (RPC).
The dot operator in Expression Language typically used for accessing the --------------------of an
object.
Properties (Page 458)
Elements
Values
Attributes
Ref: - The dot operator typically used for accessing the properties of an object

Layers represent the _____________ view of application.


Physical
Logical (Page 435)
External
None of these
Ref :- Layers represents the logical view of application

JSP action elements allow us to work with _____________.


JavaScript
JavaBeans (Page 367)
ManagedBeans
HTML
Ref: - JSP action elements allow us to work with JavaBeans

In which file do we define a servlet mapping?


Web.xml (Page 266)
Servlet.mappings
Servlet.xml
None of the given
Ref: - Save this web.xml file by placing double quotes(web.xml) around it as you did to
save .java files.
Which of the following problem occurs with lower priority threads?
Select correct option:
Race condition
Starvation (Page 232)
Average waiting time
Process death
Ref: - Second, starvation can occur for lower-priority threads if the higher-priority threads never
terminate,
sleep, or wait for I/O indefinitely.
Which of the following folder contains configuration file? Select correct option:
classes lib
bin
WEB-INF Click here for detail
Ref: - WEB-INF folder contains Configuration files

Servlet mapping is defined in ________


servlet
web.xml click here for detail rep
html
JSP
Ref: - The web.xml file defines each servlet and JSP page within a Web Application

Read more at
http://vustudents.ning.com/group/cs506webdesignanddevelopment/forum/topics/cs506-all-
current-final-term-papers-fall-2015-past-final-term-1?xg_source=activity#TzxtfJKm2yFVzFjj.99

Wrtite the State method [ 5 marks ]


Write a code about error page something . [ 5 marks ]
Write the steps to send Cookie . [ 5makrs ]
Write Tag library of El based internationalization and Rt bases xml [5 marks ]

Difference b/w Model 1 and Model 2 with respect to view . [3 marks ]


Threads Joining join( ) method [ 3 marks ]
Declaration of class level variable and method variable in JSP with example [ 3 marks ]
When we use Page-Centric Approach ? [3 marks ]

Disadvantages of not having layered structure in webapps [ 2 marks ]


Web app have name Servlet and have home.html file . write the url to run this app [ 2marks]
Which type of method is used to send request from web page to Servlet [ 2 marks ]

Read more at
http://vustudents.ning.com/group/cs506webdesignanddevelopment/forum/topics/cs506-all-
current-final-term-papers-fall-2015-past-final-term-1?xg_source=activity#TzxtfJKm2yFVzFjj.99
Answer of that diagram question is on Page 240, 241 with diagram..

Answer:
Some Important states are
. New state
-When a thread is just created
. Ready state
-Threads start() method invoked -Thread can now execute -Put it into the Ready Queue of the
scheduler
. Running state
-Thread is assigned a processor and now is running
. Dead state
-Thread has completed or exited
-Eventually disposed off by system

Read more at http://vustudents.ning.com/forum/topics/cs506-all-current-final-term-papers-fall-


2015-past-final-term-1?
groupUrl=cs506webdesignanddevelopment&xg_source=activity&groupId=3783342%3AGroup
%3A59376&id=3783342%3ATopic%3A5453825&page=2#comments#4Pef7tu9D4df6Zf0.99
80% MCQs were from past papers. Read the Solved MCQs posted by " Nazeer Ahmad Khan ". It
helped me a lot.
Subjective:
1) What does Error 403 Mean? [2 Marks]
2) What does Error 300 Mean? [2 Marks]
3) Why Controller is implemented by Servlets? [2 Marks]
4) (A) Create and Initialize an Integer in JSP Language. (B) A session named "Session" is
already created. Set the lifetime of this session for 20 minutes in JSP Language. [3 Marks]
5) Why we prefer Client Side Validation ? [3 Marks]
6) (A) Display current date and time in JSP Language. (B) A user submitted an ID named "id"
through HTML FORM, take this parameter and display in JSP Language. [3 Marks]
7) Web Applications are developed in three layers. Explain these layers and give example for
each layer. [3 Marks]
8) [5 Marks] Write the code for two servlets in the processRequest() method given below.In such
a way that user enter "name" and "accountAmount" and submit the form to FirstServlet.
FirstServlet calculate zakat on the amount given by the user and forward the request to
SecondServlet that display users "name", "accountAmount" and calculated zakat.Use the sample
code given below.
protected void processRequest (HttpServletRequest request, HttpServletResponse response)
throws ServletException, IOException {
//Write your code here
}
9) One question was related to custom Tags creation. Code was given and some blanks were
present, we had to fill in the blanks. [5 Marks]
10) Java provides different type of Web Services. Describe any 2 of them. [5 Marks]
11) How Threads are used ? Describe all the steps and provide example code for each step? [5
Marks]
12) Sorry, I can't remember one question.
Best wishes and prayers for all. May Allah bless us all with success in this semester, Ameen.

Read more at http://vustudents.ning.com/forum/topics/cs506-all-current-final-term-papers-fall-2015-


past-final-term-1?
groupUrl=cs506webdesignanddevelopment&xg_source=activity&groupId=3783342%3AGroup
%3A59376&id=3783342%3ATopic%3A5453825&page=2#comments#4Pef7tu9D4df6Zf0.99

Today's Paper...
Q . What is mean by $ and " pram " in Expression Language ?
Q . Write 2 disadvantages of JSP in ?
Q . write the Method name when GET and POST send request back ?
Q. Write the code which set the Highest Priority ? (3 marks)
Q. Write the steps to create a Thread by Inheritance ? (5 marks)
Q . A code was given to detect the mistake in code ? (5 marks)
Q . Write the diffidence between Web Page and Web service ? (5 mar

Read more at http://vustudents.ning.com/forum/topics/cs506-all-current-final-term-papers-fall-


2015-past-final-term-1?
groupUrl=cs506webdesignanddevelopment&xg_source=activity&groupId=3783342%3AGroup
%3A59376&id=3783342%3ATopic%3A5453825&page=2#comments#4Pef7tu9D4df6Zf0.99

Q.1: write the following code using Interface.(5) // File Worker.java public class Worker extends
Thread{ private String job ; //Constructor of Worker class public Worker (String j ){ job = j; } //Override
run() method of Thread class public void run ( ) { for(int i=1; i<= 10; i++) System.out.println(job + " = " +
i); } } // end class // File ThreadTest.java public class ThreadTest{ public static void main (String args[ ])
{ //instantiate three objects of Worker (Worker class is now //becomes a Thread because it is inheriting
from it)class Worker first = new Worker (first job); Worker second = new Worker (second job);
Worker third = new Worker (third job); //start threads to execute first.start(); second.start();
third.start(); }//end main } // end class
Read more at http://vustudents.ning.com/forum/topics/cs506-all-current-final-term-papers-fall-2015-
past-final-term-1?
groupUrl=cs506webdesignanddevelopment&xg_source=activity&groupId=3783342%3AGroup
%3A59376&id=3783342%3ATopic%3A5453825&page=3#comments#CHr9ODE4tCPU5Pgz.99

Q.2: if a java developer wants to create a servlet in which folder he puts web application for
deployment?(3)
Q.3: write code for Request Dispatcher-forward.(5)
Q.4: Cookie c = new Cookie (visit,10); Above code is right or wrong. Also describe reason.(2)
Q.5: one question is about session id.
(2) Q.6: write JSP directive element.(2)
Q.7: write JavaBeans design convention.(3)
Q.8: format of writing EL.(2)
Q.9: why we partitioned an application into logical layers.(5)
Q.10: parts of http request.(5)
Q.(11) advantages of JSP.(3)

Read more at http://vustudents.ning.com/forum/topics/cs506-all-current-final-term-papers-fall-


2015-past-final-term-1?
groupUrl=cs506webdesignanddevelopment&xg_source=activity&groupId=3783342%3AGroup
%3A59376&id=3783342%3ATopic
%3A5453825&page=3#comments#CHr9ODE4tCPU5Pgz.99
#cs506 ka paper .
sirf 20% mcqs past ma sy thy
subjective b ni tha past ma sy
custom tag, yield, web server application server,javaBean, upcasting sy questions thy. . 2 program likhny
thy.
#cs506..
1. How web services communicate each other?
2. If you want to write your own servlent then you should extend /subclass from servlent . Write the
name of the servlent.
3. Suppose a java developer want to send response to local host URL and also want to encode this URl.
Being a java developer which encoding method recommended for URl encoding.
4. If u want to declare a new method or varables outside of to get() / do post() method for servlat, in jsp
at class level which JSP tag will be used.
5. Suppose two program t1 and t2. Want to stop t1 to t2 complete . write the method and code.
6. Six EL(expression language)relational operation.
7. Purpose of hash mapping in session taking through cookies.
8. Purpose JSP declare tags . code example of class attribute and method
9. Java full fill some requirement to become java bans those write.
10. Write the code of following output.(sleep k code the simple)
11. Write logical layers
12. Arrange classes in package. Suitable package name
Dbconn.java
Input.jsp
Home.html
Insertdb.
Adduser.html
Read more at http://vustudents.ning.com/forum/topics/cs506-all-current-final-term-papers-fall-2015-
past-final-term-1?
groupUrl=cs506webdesignanddevelopment&xg_source=activity&groupId=3783342%3AGroup
%3A59376&id=3783342%3ATopic%3A5453825&page=3#comments#CHr9ODE4tCPU5Pgz.99

1. What information can be appended to urL?


2. What is difference between web server and Application Server?
3. single line to include a page "vu home .java" you can use any name for tags but mention which
have chosen for which tag element
4. Write a script that validate the phone number field in the form such a way if user leaves it
empty it receives a message phone number is required. It cant be left empty..5
5. which class we used for request and response in our java code?
6. Write the code for IncludeServlet in the processRequest() method given below.In such a way
that user enter "name" and "accountAmount" and submit the form to NewServlet. NewServlet
show the username and amount with message please wait your amount is send and
IncludeServlet that display user Thank you.
7. Write output:
Code was given: on page no 217 on handsout.
8. Aik question login sy related tha
Ans:
String id=request.getParameter("userid");
String password=request.getParameter("pwd");
if(id.equals("vulms" && password.equals("admin")){
response.sendRedirect("welcome.jsp");
}
else{
response.sendRedirect("error.jsp");
}catch (Exception e){
system.out.println(e.getMessage());
}
Mostly mcqs were from past papers. Remember me in yours prayers

Read more at http://vustudents.ning.com/forum/topics/cs506-all-current-final-term-papers-fall-


2015-past-final-term-1?
groupUrl=cs506webdesignanddevelopment&xg_source=activity&groupId=3783342%3AGroup
%3A59376&id=3783342%3ATopic
%3A5453825&page=3#comments#CHr9ODE4tCPU5Pgz.99

ain Subjective Questions:


Explain 300 error?
How to generate unique session id for each user?
Write any two different ways to create session?
Write javascript code to validate an empty field?
JSP code was given and we are asked to write JSP code to include header and
footer(header and footer file names were given)?
Servlet code was given and asked to write it's equivalent JSP code(Servlet code was just
printing today's date like, Today is {date})?
Write steps to deploy a project in Tomcat?

Read more at http://vustudents.ning.com/forum/topics/cs506-all-current-final-term-papers-fall-


2015-past-final-term-1?
groupUrl=cs506webdesignanddevelopment&xg_source=activity&groupId=3783342%3AGroup
%3A59376&id=3783342%3ATopic
%3A5453825&page=3#comments#CHr9ODE4tCPU5Pgz.99

my today paper was at 10:30


98% mcqs from past papers...
subjective past papers sy nahi tha
when we DOUBLE click on GUI a new file open what is its name?2
distinguish advantage of HTTP session?3
custom tag sy related q tha
role of layers in application if layers are not used what will be disadvantage?3
ak q tha jis me processes or periorties di hui thi yeild() or Sleep()ko use krna tha usme 5
baqi yad nahi sorry....
best of luck..nd pray for me too..
Read more at http://vustudents.ning.com/forum/topics/cs506-all-current-final-term-papers-fall-2015-
past-final-term-1?
groupUrl=cs506webdesignanddevelopment&xg_source=activity&groupId=3783342%3AGroup
%3A59376&id=3783342%3ATopic%3A5453825&page=3#comments#CHr9ODE4tCPU5Pgz.99

Anda mungkin juga menyukai