We are here with you hands in hands to facilitate your learning & don't appreciate the idea of copying or replicating solutions. Read More>>

Looking For Something at vustudents.ning.com? Click Here to Search

www.bit.ly/vucodes

+ Link For Assignments, GDBs & Online Quizzes Solution

www.bit.ly/papersvu

+ Link For Past Papers, Solved MCQs, Short Notes & More


Dear Students! Share your Assignments / GDBs / Quizzes files as you receive in your LMS, So it can be discussed/solved timely. Add Discussion

How to Add New Discussion in Study Group ? Step By Step Guide Click Here.

FINALTERM EXAMINATION

Spring 2011

CS506- Web Design and Development

                                                              Umair sid     

 

What I remember are given below. Good Luck

 

From the following; which component is/are used in directory Structure of web components:

       ► index.htm, JSP, Images etc.

       ► Web-inf, web.xml

       ► Classes, servlets classes

       ►  lib, jar files

       ► All of these

From following; which is the main reason that enters a thread into dead state:

       ► a)It dies a natural death because thread completes its execution.

       ► b)It is killed because someone invoked its stop method.

       ► Both a and b.         ► None of these.

 

RPC stands for

       ► Remote Personal Computer (RPC)       ► Remote Procedure Calls (RPC).

       ► Remote Procedure Client (RPC)       ► None of these

 

From the following which one is not a built-in validator?

► DoubleRangeValidator ► LongRangeValidator► LengthValidator ► StringValidator

 

The ___________ represent the state of component.

 

       ► View       ► Model       ► Controller       ► Component

 

The following value of JavaBean’s scope attribute has local variable.

 

       ► Page       ► Request       ► Session       ► Application

 

Which of the following is not part of http response?

 

       ► Result Code       ► URI       ► Header fields       ► Body

   

In which file do we define a servlet mapping?

 

       ► Web.xml       ► Servlet.mappings       ► Servlet.xml       ► None of the given

   

Web server is a software which provides services to access _________.

       ► Internet       ► Intranet       ► Extranet       ► All of the given

   

DSN stands for ___________.

 

       ► Domain System Name       ► Data Source Name      ► Database System Name

 

Managed Bean is JavaBeans which are defined in ------------------

 

       ► Configuration file       ► Source file       ► Class file       ► None of these

   

UDDI stands for

 

       ► Universal Description, Discovery & Integration (UDDI)

       ► Universal Data, Discovery & Integration (UDDI)

       ► Universal Data, Database & Integration (UDDI)        ► None of these

 

Which of the following is a correct order for Bean scope in JSP page from least visible to most visible?

       ► application, session, request, page       ► page, request, session, application

       ► session, page, request, application       ► application, session, page, request

   

Pack directory structure of J2EE web application is __________

 

       ► Where each directory & file exists in the file system separately 

       ► Used during development of web application

       ► Used to deploy web application       ► None of the given options

  

By using forward() method of _________ object, the called resource will be able to access the original request object.

       ► HttpServletRequest       ► HttpServletResponse

       ► RequestDispatcher       ► ServletConfig

 

From which object do you ask for DatabaseMetaData?

 

Connection      ResultSet          DriverManager      Driver

 

JavaBeans are?

 

A special Java class file

Servlets        Applets       A Special form of JSP       None of Given

 

Which of the following range of response code indicates that request was successful?

Select correct option:

100-199    200-299        300-399      400-499

 

DSN stands for _______

1. Data System Name                 2  . Domain system Name  

 3. Data Source Name                     Database System Name

CREATE, ALTER, DROP are _________ SQL statements.

 

1. DML         2. DDL       3. DCL      4. None of given

 

How many forms of redirect?

_ One      _Two       _Three     _Four

 

Strings in java are represented as __________

 

Primitive data types       Reference data types       Native data types      Operators

 

Managed Bean is JavaBeans which are defined in ------------------

 

► Configuration file    ► Source file    ► Class file      ► None of these

 

From which object do you ask for DatabaseMetaData?

 

A. Connection    B. ResultSet       C. DriverManager       D. Driver

 

What are the disadvantages of url rewriting 3 marks

What is impact a java bean object can produce when it is stored in an application 3 marks

When thread's run() method is invoked? 3 marks

What is differences between getRequestDispatcher(String path) method using javax.servlet.httpServletRequest or using servletContext? 3 marks

What are packages? and how they are organized? 5 marks

Write literals used in Expression Language   5 marks

 

 FINALTERM  EXAMINATION Fall 2008

CS506- Web Design and Development (Session - 1)

Solved and shared by

Time: 120 min

    

Question No: 1    ( Marks: 1 )    - Please choose one

 From the Following; which we don’t include in simple tag while creating JSP custom tags:

 

 

       ► Start of tag

       ► End of tag

       ► Attributes

       ► None of these

   

Question No: 2    ( Marks: 1 )    - Please choose one

 From the following; which component is/are used in directory Structure of web components:

       ► index.htm, JSP, Images etc..

       ► Web-inf, web.xml

       ► Classes, servlets classes

       ►  lib, jar files

       ► All of these

Question No: 3    ( Marks: 1 )    - Please choose one

 From following; which is the main reason that enters a thread into dead state:

       ► a)It dies a natural death because thread completes its execution.

       ► b)It is killed because someone invoked its stop method.

       ► Both a and b.

       ► None of these.

   

Question No: 4    ( Marks: 1 )    - Please choose one

 From the following; which approach is used in java to create threads,

 

 

       ► Interface

       ► Inheritance

       ► Both Interface and Inheritance

       ► None of these.

   

Question No: 5    ( Marks: 1 )    - Please choose one

 RPC stands for

       ► Remote Personal Computer (RPC)

       ► Remote Procedure Calls (RPC).

       ► Remote Procedure Client (RPC)

       ► None of these

Question No: 6    ( Marks: 1 )    - Please choose one

 From the following which one is not a built-in validator?

       ► DoubleRangeValidator

       ► LongRangeValidator

       ► LengthValidator

       ► StringValidator

Question No: 7    ( Marks: 1 )    - Please choose one

 -------------can be used to specify dynamic attribute values for JSTL actions without using full-blown programming language.

       ► EL

       ► RT

       ► Both EL and RT

       ► None of these

   

Question No: 8    ( Marks: 1 )    - Please choose one

 The dot operator in Expression Language typically used for accessing the --------------------of an object.

       ► Properties

       ► Elements

       ► Values

       ► Attributes

   

Question No: 9    ( Marks: 1 )    - Please choose one

 Tiers represent the _____________ view of application.

       ► Physical

       ► Logical

       ► External

       ► None of these

Question No: 10    ( Marks: 1 )    - Please choose one

 Layers represent the _____________ view of application.

       ► Physical

       ► Logical

       ► External

       ► None of these

   

Question No: 11    ( Marks: 1 )    - Please choose one

 Which of the following is appropriate for Page-with-Bean approach?

 

 

       ► The code becomes a mixture of presentation, business and data access logic.

       ► The maintenance of the application becomes a nightmare.

       ► A lot of code is also get duplicated.

       ► All the business logic goes into one application.

   

Question No: 12    ( Marks: 1 )    - Please choose one vuzs

 The ___________ represent the state of component.

       ► View

       ► Model

       ► Controller

       ► Component

   

Question No: 13    ( Marks: 1 )    - Please choose one

 The following value of JavaBean’s scope attribute has local variable.

       ► Page

       ► Request

       ► Session

       ► Application

Question No: 14    ( Marks: 1 )    - Please choose one

 JSP action elements allow us to work with _____________.

       ► JavaScript

       ► JavaBeans

       ► ManagedBeans

       ► HTML

   

Question No: 15    ( Marks: 1 )    - Please choose one

 A bean class ___________ have any public instance variables/attributes (fields).

       ► Can

       ► Can’t

       ► Must

       ► Shouldn’t

   

Question No: 16    ( Marks: 1 )    - Please choose one

 Expression is a code fragment which returns ___________.

       ► Integer

       ► String

       ► Depends on the expression

       ► Nothing

Question No: 17    ( Marks: 1 )    - Please choose one

 JSP file is compiled ___________.

       ► Whenever there is some modification in the file

       ► Whenever it is accessed

       ► Whenever browser is restarted

       ► Whenever the page is refreshed

   

Question No: 18    ( Marks: 1 )    - Please choose one

 Servlet session and JSP session have ___________ abilities.

       ► Different

       ► Same

       ► Critical

       ► None of these

   

Question No: 19    ( Marks: 1 )    - Please choose one

 Which of the following is not part of http response?

       ► Result Code

       ► URI

       ► Header fields

       ► Body

   

Question No: 20    ( Marks: 1 )    - Please choose one

 In which file do we define a servlet mapping?

       ► Web.xml

       ► Servlet.mappings

       ► Servlet.xml

       ► None of the given

   

Question No: 21    ( Marks: 1 )    - Please choose one

 Which of the following is a type of Java web application technologies?

       ► JSTL

       ► JSF

       ► JSP

       ► All of the given

   

Question No: 22    ( Marks: 1 )    - Please choose one

 Extra information can be appended to URL using ____________.

       ► Extra path information

       ► Added parameters

       ► Custom change

       ► All of the given

   

Question No: 23    ( Marks: 1 )    - Please choose one

 Web server is a software which provides services to access _________.

       ► Internet

       ► Intranet

       ► Extranet

       ► All of the given

   

Question No: 24    ( Marks: 1 )    - Please choose one

 When defining a method you must include a ___________ to declare any exception that might be thrown but is not caught in the method. 

       ► try block

       ► finally block

       ► catch block

       ► throws-clause

   

Question No: 25    ( Marks: 1 )    - Please choose one

 In an applet class definition, the----------method takes the place of the constructor. 

       ► paint();

       ► main();

       ► init();

       ► run() ;

   

Question No: 26    ( Marks: 1 )    - Please choose one

 DSN stands for ___________.

       ► Domain System Name

       ► Data Source Name

       ► Database System Name

       ► Database Simple Name

   

Question No: 27    ( Marks: 1 )    - Please choose one

 From following classes; which one can’t be instantiated?

       ► Super class

       ► Abstract Class

       ► Anonymous Class

       ► Concrete Class

   

Question No: 28    ( Marks: 1 )    - Please choose one

 Converting bigger data types into smaller one is called ----------

 

 

       ► Up casting

       ► Down casting

       ► In casting

       ► Out casting

    

Question No: 29    ( Marks: 1 )    - Please choose one

 Java provide ------------------

       ► Overloading

       ► Overriding

       ► Pointers

       ► Multiple Inheritance

   

Question No: 30    ( Marks: 1 )    - Please choose one

 int x = 7/2;

value of x is:

 

 

       ► 1

       ► 2

       ► 3.5

       ► 3

   

Question No: 31    ( Marks: 1 )

 Given the request path below, which part is context path, servlet path and path info?

   /vubookshop/edu/index.html
unable to understand the question

   

Question No: 32    ( Marks: 1 )

 Write the XML tags for the following scripting elements in JSP? 

§        Comments:

§        Declaration:

 

Comments: No equivalent tag is defined

Declaration: <jsp:declartion> </jsp:declaration>

Expression: <jsp:expression> </jsp:expression>

Scriptlet: <jsp:scriptlet> </jsp:scriptlet>

 

 

   

Question No: 33    ( Marks: 2 )

 What impact a JavaBeans object can produce when it is stored in Servlet Request object?

 

 

 JavaBean object that is stored in Servelet Request object remain accessible for the duration of current request. In other words until you continue to forward request to another servlet/JSP the bean value would be available    

 

Question No: 34    ( Marks: 2 )

 What invokes a thread’s run() method?

 

 

After a thread is started, via its start() method or that of the Thread class, the JVM invokes the thread's run() method when the thread is initially executed.

   

Question No: 35    ( Marks: 3 )

 What is the significance of error page?

 

We can configure error pages in jsp and servlets to direct the control to a custom error page, showing a friendly error message to the user when an exception is thrown in the page. Error pages enable you to customize error pages. You can even hide them from the user's view entirely, if you want. This also makes possible to maintain a consistent look and feel throughout an application, even when those dreaded error messages are thrown. An Error JSP is called by the web server when an uncaught exception gets occurred.

 

 

   

Question No: 36    ( Marks: 3 )

 Which type of information can be appended to URL?

With URL rewriting, the parameter that we want to pass back and forth  between the server and client is appended to the URL. This appended information can be retrieve by parsing the URL. This information can be in the form of:

Extra path information,

Added parameters,

Some custom, server-specific URL change

 

 

Question No: 37    ( Marks: 3 )

 Differentiate between Sequential Execution and multithreading.

Every program has atleast one thread. Programs without multithreading executes sequentially. That is, after executing one instruction the next instruction in sequence is executed. If a function is called then until the completion of function the next instruction is not executed. Similarly if there is a loop then instructions after loop get only executed when loop is completed.

Multithreading allows two parts of the same program to run concurrently A problem with single-threaded applications is that lengthy activities must complete before other activities can begin. In a multithreaded application, threads can be distributed across multiple processors (if they are available) so that multiple tasks are performed concurrently and the application can operate more efficiently. Multithreading can also increase performance on single-processor systems that simulate concurrency—when one thread cannot proceed, another can use the processor.

 

 

 

 

 

 

 

 

  

Question No: 38    ( Marks: 5 )

 Which technology is used in JAVA to support following layers?

1.      Presentation Layer  client side HTML Applet Server side JSF Servelet JSF

2.      Business Layer EJB Java Beans

3.      Data Layer  DAO Connectors

 

 

   

Question No: 39    ( Marks: 5 )

 How cookies are sent to a client?

   Create a Cookie Object

Cookie c = new Cookie (“name”, “value”);

 

 

Setting Cookie Attributes

c.setMaxAge(60);

 

 

Place the Cookie into HTTP response

Response.addCookie(c);

 

Question No: 40    ( Marks: 10 )

 What are the characteristics of web services?

Interoperable

Economical

Automatic

Accessible

Available

Scalable

 

Question No: 41    ( Marks: 10 )

 What is the usage of sleep (int time) method?

Sleep method will Causes the currently executing thread to wait for the time (milliseconds) specified

Waiting is efficient equivalent to non-busy. The waiting thread will not occupy the processor.

Threads come out of the sleep when the specified time interval expires or when interrupted by some other thread

Thread coming out of sleep may go to the running or ready state depending upon the availability of the processor.

High priority threads should execute sleep method after some time to give low priority threads chance to run otherwise starvation may occur

Sleep can be used for delay purpose i.e. anyone cal call Thread.sleep()method

 

 

 

 

 

FINALTERM  EXAMINATION

Spring 2010

 

CS506- Web Design and Development 

                                            Solved by umair sid       

 DSN stands for ___________.

► Domain System Name ► Data Source Name► Database System Name

       ► Database Simple Name

    One application has _________ servlet context(s).

       ► 1       2       ► 3      ► 4

 In packages, we organize files into different directories according to their ____________.

       ► Functionality       ► Usability       ► Category       All of these

    Entire JSP page gets translated into a servlet ____________.

► Once Every time when it is accessed

► Every time when the page is refreshed ►Every time when the browser is restarted

 A bean class ___________ be serializable.

       ► Can       ► Can’t       Must       ► Shouldn’t

    JSP action elements allow us to work with _____________.

       ► HTML    ► JavaScript       JavaBeans       ► ManagedBeans

 MVC stands for _____________.

       ► Model View Content   Model View Controller► Multi View Controller

       ► Multi View Content

    Layers represent the _____________ view of application.

       ► Physical    Logical       ► External       ► None of these

    Tiers represent the _____________ view of application.

       Physical    ► Logical       ► External       ► None of these

    Managed Bean is JavaBeans which are defined in ------------------

       ► Configuration file       ► Source file       ► Class file       None of these

 UDDI stands for

       Universal Description, Discovery & Integration (UDDI)

       ► Universal Data, Discovery & Integration (UDDI)

       ► Universal Data, Database & Integration (UDDI)        ► None of these

    _____________ is a standard web based application framework.

       ► Java       ► Servlet       ► JSP       JSF

 Which of the following is a general purpose container?

    ► JFrame       ► JDialog       ► JPanel       ► JWindow

 Which of the following component is/are used in directory Structure of web components?

► html, JSP, Images etc.     ► web.xml, Classes folder►  lib, jar files

       ► All of the given options

    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

 ► session, page, request, application ► application, session, page, request

   

 Which of the following is not included in simple tag while creating JSP custom tags?

   ► Start of tag    ► End of tag  ► Attributes ► None of the given options

 AWT is also called ______________.

       ► Light Weight Component        ► Medium Weight Component

       ► Heavy Weight Component       ► None of the given options

    Which of the following is NOT a standard method called as a part of the JSP life cycle?

► jspInit()   jspService()  ► _jspService()     ► jspDestroy()

   

 Initialization parameters of a servlet are defined in __________ file.

       ► html        ► JSP       ► web.xml       servlet

  The getSession() method of _________ returns HttpSession object.

       HttpServletResponse  ► HttpServletRequest  ► ServletConfig

        ► ServletContext

  Unpack directory structure of J2EE web application is __________

 ► Known as Web Archive file (WAR)► Used during development of web application

 ► Used to deploy web application       None of the given options

  Which of the following directory is the top level TOMCAT directory that contains all the application deployed on web server?

       webapps       ► bin       ► lib        ► tags

  Servlet mapping of a servlet is defined in _____________ file.

 ► JSP    ► HTML       web.xml        ► Servlet

  By using forward() method of _________ object, the called resource will be able to access the original request object.

► HttpServletRequest       HttpServletResponse   ► RequestDispatcher

► ServletConfig

 A --------in HashMap is associated with each object that is stored.

       ► None of the given options       ► Key       ► Value ► Attribute

    Which of the following must be used to compare the values of two strings?

      = operator   ► == operator  ► equals() method   ► compare() method

    Mouse events can be trapped for ________ GUI component.

       ► JFrame    ► JPanel       ► JButton       All of the given options

 Port is a transport address to which processes can ________ for connections request.

       ► read       ► Write     ► Listen       ► None of the given options

    In which file do we define a servlet mapping?

       Web.xml       ► index.html  ► Servlet.xml       ► None of the given options

    Which of the following is appropriate for Page-with-Bean approach?

 ► The code becomes a mixture of presentation, business and data access logic.

 ► The maintenance of the application becomes a nightmare.

 ► A lot of code is also get duplicated.

  All the business logic goes into one application.

    How to track a user session in Servlets?

Answer:

the user can be tracked in a serlver by it’s state stored on the client side. These states are stored in the form of text or some values etc. this can also be a cookie. By storing this on the use side, user can be tracked by using the information written in it.

 Why do we use doTag() method in tag handler class?

    Answer: the dotag() method is used to implement/override to code functionality of tag. And this is invoked when the end element of the tag encountered.

 Differentiate between Layers and Tiers.

Answer:

Layers are simply logical grouping of the software components that make up the application or service, whereas Tiers refer to the physical residence of those layers. In simple words layers represents the logical view of application while Tiers represents physical view of application.

 Why is direct call of paint() method not recommended?

Answer:

The direct call of paint() is not recommended because all the graphical processes done automatically by the computer and is does not feel due to the modern computers processing speed. So we don’t call paint() method by recommendation.

  What is the preferred size of a component?

  

 Name three stages of servlet life cycle.

Answer:

three stages of servlet life cycle are:

1-      Initialize

2-      Service

3-      destroy

   

Question No: 37    ( Marks: 3 )

 What is the difference between variable declared inside a declaration part and variable declared in scriplet part?

 

   

Question No: 38    ( Marks: 3 )

 How does JSF provide Navigation?

    Answer: JSF navigation determines the control flow of the web application. Jsf provide a default navigational handler and this behavior can be configured in the configuration. We can do this also visually by using tools like sun studio creator.

Question No: 39    ( Marks: 5 )

 What is expression in JSP? Give an example.

   

Question No: 40    ( Marks: 5 )

 What is validator? Discuss built-in-validators.

FINALTERM EXAMINATION

Fall 2008

CS506- Web Design and Development (Session - 1)

 

                                          UMAIAR  SID…… 

From the Following; which we don’t include in simple tag while creating JSP custom tags:

 

► Start of tag      ► End of tag    ► Attributes       ► None of these

   

From the following; which component is/are used in directory Structure of web components:

► index.htm, JSP, Images etc..   ► Web-inf, web.xml

       ► Classes, servlets classes        ►  lib, jar files

       ► All of these

   

From following; which is the main reason that enters a thread into dead state:

       ► a)It dies a natural death because thread completes its execution.

       ► b)It is killed because someone invoked its stop method.

       ► Both a and b.       ► None of these.

   

From the following; which approach is used in java to create threads,

 

► Interface  ► Inheritance       Both Interface and Inheritance       ► None of these.

   

RPC stands for

       ► Remote Personal Computer (RPC)    ► Remote Procedure Calls (RPC).                              

       ► Remote Procedure Client (RPC)       ► None of these

   

From the following which one is not a built-in validator?

 

  ► DoubleRangeValidator      ► LongRangeValidator

  ► LengthValidator                  ► StringValidator

   

-------------can be used to specify dynamic attribute values for JSTL actions without using full-blown programming language.

 

       EL      ► RT       ► Both EL and RT       ► None of these

   

The dot operator in Expression Language typically used for accessing the --------------------of an object.

Properties       ► Elements      ► Values      ► Attributes

   

Tiers represent the _____________ view of application.

     

 ► Physical       ► Logical       ► External       ► None of these 

Layers represent the _____________ view of application.

 

  ► Physical       ► Logical     ► External      ► None of these

   

Which of the following is appropriate for Page-with-Bean approach?

 

 ► The code becomes a mixture of presentation, business and data access logic.

       ► The maintenance of the application becomes a nightmare.

       ► A lot of code is also get duplicated.

       ► All the business logic goes into one application.

 

The ___________ represent the state of component.

 

       ► View       Model       ► Controller       ► Component

   

The following value of JavaBean’s scope attribute has local variable.

 

       ► Page       ► Request       ► Session       ► Application

   

JSP action elements allow us to work with _____________.

 

       ► JavaScript       ► JavaBeans       ► ManagedBeans       ► HTML

   

A bean class ___________ have any public instance variables/attributes (fields).

 

       ► Can       ► Can’t        ► Must       ► Shouldn’t

   

Expression is a code fragment which returns ___________.

 

       ► Integer       ► String       ► Depends on the expression    ► Nothing

   

JSP file is compiled ___________.

       ► Whenever there is some modification in the file

       Whenever it is accessed        ► Whenever browser is restarted

       ► Whenever the page is refreshed

   

Servlet session and JSP session have ___________ abilities.

 

       ► Different       ► Same       ► Critical       None of these

   

Which of the following is not part of http response?

      

► Result Code       ► URI     Header fields    ► Body

   

In which file do we define a servlet mapping?

      

 Which of the following is a type of Java web application technologies?

 

       ► JSTL       ► JSF     ► JSP      ► All of the given

   

Extra information can be appended to URL using ____________.

 

Extra path information  ► Added parameters  ► Custom change  ► All of the given

   

Web server is a software which provides services to access _________.

 

► Internet       ► Intranet     ► Extranet    ► All of the given

   

When defining a method you must include a ___________ to declare any exception that might be thrown but is not caught in the method. 

 

       ► try block       ► finally block       ► catch block       ► throws-clause

   

In an applet class definition, the----------method takes the place of the constructor. 

 

       ► paint();       ► main();       ► init();       ► run() ;

   

DSN stands for ___________.

 

Domain System Name   ► Data Source Name   ► Database System Name

 ► Database Simple Name

   

From following classes; which one can’t be instantiated?

 

► Super class► Abstract Class► Anonymous Class► Concrete Class

   

Converting bigger data types into smaller one is called ----------

 

       ► Up casting       ► Down casting  ► In casting       ► Out casting

   

Java provide ------------------

 

       ► Overloading       ► Overriding ► Pointers ► Multiple Inheritance

 

 int x = 7/2;    value of x is:

 

       ► 1       ► 2            ► 3.5     ► 3

 

 

+ How to Follow the New Added Discussions at Your Mail Address?

+ How to Join Subject Study Groups & Get Helping Material?

+ How to become Top Reputation, Angels, Intellectual, Featured Members & Moderators?

+ VU Students Reserves The Right to Delete Your Profile, If?


See Your Saved Posts Timeline

Views: 1208

.

+ http://bit.ly/vucodes (Link for Assignments, GDBs & Online Quizzes Solution)

+ http://bit.ly/papersvu (Link for Past Papers, Solved MCQs, Short Notes & More)

+ Click Here to Search (Looking For something at vustudents.ning.com?)

+ Click Here To Join (Our facebook study Group)

Replies to This Discussion

some of Subjective cs506

...................................

A hyHow does multithreading take place on a computer with a single CPU?(3 marks)

Ans:

It is the responsibility of scheduler to organise multiple tasks by allocating execution time to each task, in such a way that it seems to be executed in a sequential fashion to rest of the world.

What are the two ways to read initialization parameters of a servlet? 5 marks

The ServletConfig object can be used to read initialization parameter. 

public void init(ServletConfig config) throws ServletException { 

string name =config.getInitParameter(“paramName”); 

}

Another way to read initialization parameters out side the init () method is 

Call getServletConfig() to obtain the ServletConfig object 

Use getInitParameter() of ServletConfig to read initialization parameters

public void anyMethod // defined inside servlet{ 

ServletConfig config = getServletConfig();

String name = config.getInitParameter(“param_name");

}

 

What is meant by Twin Tag Libraries?(5 marks)

JSTL comes in two flavors to support various skill set personal

Expression Language (EL) version :

- Dynamic attribute values of JSTL tags are specified using JSTL expression language (i.e.   ${expression})

The EL based JSTL tag libraries Sql,Core,Internationalization/ Format  ,XML having prefixes of c,sql,fmt,x

 

Request Time (RT) version:

- Dynamic attribute values of JSTL tags are specified using JSP expression

(i.e. <%= expression %>)

The RT based JSTL tag libraries Sql,Core,Internationalization/ Format  ,XML having prefixes of c_rt,sql_rt,fmt_rt,x_rt

 

What impact a JavaBeans object can produce when it is stored in Page scope?  (3 marks)

Beans created with page scope are  always  accessed (their values) by jsp:getProperty, jsp:setProperty, scriptlets or expressions.when MyBean object  , are not  available.  BEAN specify scope “page” results in using the object on the same page where they are created.  

The scope attribute is optional and default to page. 

A page scoped variable is set to value of request parameter by using

paramimplicit object. If parameter is defined in JSP page as:

  <input type=”text” value = “parameter” /> 

 

 Can a vector contain heterogenous objects? If yes then explain why?(3 marks)

Ans: Yes a Vector can contain heterogenous objects. Because a Vector stores everything in terms of Object.

 How does JSF provide Navigation?(3 marks)

Page navigation determines the control flow of a Web application. JSF provides a default navigational handler and this behavior can be configured in configuration. However, you can do it visually in most tools like Sun Studio Creator 

 

 

 How can we read cookies from the client? (3 marks)

To read the cookies that come back from the client, following steps are generally followed. 

Reading Cookies from the Client 

To read incoming cookies, get them from the request object of the HttpServeltRequest by calling following method 

Cookie cookie s[] = request.getCookies(); 

This call returns an array of Cookies object corresponding to the name & values that came in the HTTP request header. 

Looping down Cookies:

Once you have an array of cookies, you can iterate over it. Two important methods of Cookie class are getName() and getValue().These are used to retrieve cookie name and value respectively.

 

 

 

 

Write the code of java beans class named as "MyBean" and having an attribute named "name" of String data type.

 5 marks

package My Bean; 

port java.io.*; 

Public class MyBeanClass implements Serializable{ 

   private String name; 

      // no argument constructor 

   public MyBeanClass() {

   name = ""; 

   }

//setter

public void setName(String n){

name = n;

}

// getters 

   public String getName( ){

   return name; 

}

} // end class MyBeanClass

What are the high-level thread states?2 mark

The high-level thread states are runable,running ,waiting,sleeping,blocked,blocked on i/o

 

 

Name any two typical solutions of session tracking?

The typical solutions come across to accomplish session tracking. These are: 

1  Cookies 

2  URL Rewriting 

 

Write the syntax of Update SQL query.

Used to execute for INSERT, UPDATE or DELETE SQL statements.

For example, 

  int num = stmt.executeUpdate(“DELETE from Person WHERE id = 2” ); 

 

What type of problem persists with Struts Framework?

Struts Framework creates following problems

Adds complexity and doesn’t provide UI tags 

Very Java programmer centric 

 

What is the meaning of error page if after using url http://localhost:8080/myapp/index.html in internet explorer an error appear showing error status 404 at server side?

Ans:

The 404 or Not Found error message is a HTTP standard response code in TOMCAT  indicating that the client was able to communicate with the server, but the server could not find what was requested.

 

 

How does multithreading take place on a computer with a single CPU?(3 marks)

Ans:

t is the responsibility of scheduler to organise multiple tasks by allocating execution time to each task, in such a way that it seems to be executed in a sequential fashion to rest of the world.

What are the two ways to read initialization parameters of a servlet? 5 marks

The ServletConfig object can be used to read initialization parameter. 

public void init(ServletConfig config) throws ServletException { 

string name =config.getInitParameter(“paramName”); 

}

Another way to read initialization parameters out side the init () method is 

Call getServletConfig() to obtain the ServletConfig object 

Use getInitParameter() of ServletConfig to read initialization parameters

public void anyMethod // defined inside servlet{ 

ServletConfig config = getServletConfig();

String name = config.getInitParameter(“param_name");

}

 

What is meant by Twin Tag Libraries?(5 marks)

JSTL comes in two flavors to support various skill set personal

Expression Language (EL) version :

- Dynamic attribute values of JSTL tags are specified using JSTL expression language (i.e.   ${expression})

The EL based JSTL tag libraries Sql,Core,Internationalization/ Format  ,XML having prefixes of c,sql,fmt,x

 

Request Time (RT) version:

- Dynamic attribute values of JSTL tags are specified using JSP expression

(i.e. <%= expression %>)

The RT based JSTL tag libraries Sql,Core,Internationalization/ Format  ,XML having prefixes of c_rt,sql_rt,fmt_rt,x_rt

 

What impact a JavaBeans object can produce when it is stored in Page scope?  (3 marks)

Beans created with page scope are  always  accessed (their values) by jsp:getProperty, jsp:setProperty, scriptlets or expressions.when MyBean object  , are not  available.  BEAN specify scope “page” results in using the object on the same page where they are created.  

The scope attribute is optional and default to page. 

A page scoped variable is set to value of request parameter by using

paramimplicit object. If parameter is defined in JSP page as:

  <input type=”text” value = “parameter” /> 

 

 Can a vector contain heterogenous objects? If yes then explain why?(3 marks)

Ans: Yes a Vector can contain heterogenous objects. Because a Vector stores everything in terms of Object.

 How does JSF provide Navigation?(3 marks)

Page navigation determines the control flow of a Web application. JSF provides a default navigational handler and this behavior can be configured in configuration. However, you can do it visually in most tools like Sun Studio Creator 

 

 

 How can we read cookies from the client? (3 marks)

To read the cookies that come back from the client, following steps are generally followed. 

Reading Cookies from the Client 

To read incoming cookies, get them from the request object of the HttpServeltRequest by calling following method 

Cookie cookie s[] = request.getCookies(); 

This call returns an array of Cookies object corresponding to the name & values that came in the HTTP request header. 

Looping down Cookies:

Once you have an array of cookies, you can iterate over it. Two important methods of Cookie class are getName() and getValue().These are used to retrieve cookie name and value respectively.

 

 

 

 

Write the code of java beans class named as "MyBean" and having an attribute named "name" of String data type.

 5 marks

package My Bean; 

port java.io.*; 

Public class MyBeanClass implements Serializable{ 

   private String name; 

      // no argument constructor 

   public MyBeanClass() {

   name = ""; 

   }

//setter

public void setName(String n){

name = n;

}

// getters 

   public String getName( ){

   return name; 

}

} // end class MyBeanClass

 

plz in files ko word  or pdf ke form may upload kar day...........

in word form 

Attachments:

MCQ's CS506

Attachments:

Thanks alot, Appreciated.

RSS

Latest Activity

+ M.Tariq Malik replied to +¢αяєℓєѕѕ gιяℓ's discussion MCM301 - Communication skills Assignment No.1 Due Date Nov 27, 2019 in the group MCM301 Communication skills
39 seconds ago
+ M.Tariq Malik liked +¢αяєℓєѕѕ gιяℓ's discussion MCM301 - Communication skills Assignment No.1 Due Date Nov 27, 2019
2 minutes ago
+ M.Tariq Malik replied to + M.Tariq Malik's discussion MGT603 Strategic Management Assignment No 01 Fall 2019 Solution & Discussion in the group MGT603 Strategic Management
2 minutes ago
+ M.Tariq Malik replied to + M.Tariq Malik's discussion MGT603 Strategic Management Assignment No 01 Fall 2019 Solution & Discussion in the group MGT603 Strategic Management
3 minutes ago
Profile Iconmubashar hussain, Hurain, Abdul Majid Jamil and 13 more joined Virtual University of Pakistan
3 minutes ago
+ M.Tariq Malik liked UMER UMER's discussion What is Love?
4 minutes ago
+ M.Tariq Malik liked Abdul Majid Jamil's discussion for assignment of zoogy on topic wildlife counting
5 minutes ago
Abdul Majid Jamil posted a discussion
6 minutes ago
+ ! ! ! ! ! ! BaDd TamEeZ updated their profile
7 minutes ago
+ NurAl Ain + updated their profile
7 minutes ago
Abdul Majid Jamil posted a status
"i am the student of m.phill zoology ...m happy to fined that place ...i need some help"
7 minutes ago
+ M.Tariq Malik replied to + M.Tariq Malik's discussion ENG201 Business and Technical English Writing Assignment No 01 Fall 2019 Solution & Discussion in the group ENG201 Business and Technical English Writing
8 minutes ago
+ M.Tariq Malik liked UMER UMER's discussion Ego is the Enemy.
9 minutes ago
Mr khan liked + M.Tariq Malik's discussion ECO601 Business Econometrics Assignment No 01 Fall 2019 Solution & Discussion Due Date: 21-11-2019
9 minutes ago
+ M.Tariq Malik liked + ! ! ! ! ! ! ! ! ! ! ! ! ! ! !'s discussion 100 Instructions from the Quran
10 minutes ago
+ M.Tariq Malik replied to + M.Tariq Malik's discussion MGT111 Introduction to Public Administration Assignment No 01 Fall 2019 Solution & Discussion Due Date: 26-11-2019 in the group MGT111 Introduction to Public Administration
11 minutes ago
+ M.Tariq Malik liked + M.Tariq Malik's discussion MGT111 Introduction to Public Administration Assignment No 01 Fall 2019 Solution & Discussion Due Date: 26-11-2019
11 minutes ago
+! ! ! Minnion! ! !+ updated their profile
11 minutes ago
+ M.Tariq Malik added a discussion to the group MGT111 Introduction to Public Administration
11 minutes ago
Irfan khan joined + M.Tariq Malik's group
12 minutes ago

© 2019   Created by + M.Tariq Malik.   Powered by

Promote Us  |  Report an Issue  |  Privacy Policy  |  Terms of Service