Scripts- Server Side [Computer Associates Placement]: Sample Questions 7 - 8 of 18

Glide to success with Doorsteptutor material for competitive exams : get questions, notes, tests, video lectures and more- for all subjects of your exam.

Question 7

Scripts- Server Side
Edit

Appeared in Year: 2004

Describe in Detail

Essay▾

Difference between < jsp: Forward > and < jsp: Include > tag.

Explanation

Different between Jsp: Forward and Jsp: Include Tag
jsp: Forwardjsp: Include
Occurs at translation timeOccurs at request time
Performance comparatively slowerPerformance faster
Number servlets created only one timeNumber servlet created multiple time
It used when content of included file DOES NOT CHANGE often like advertisement bannersIt used when content of included file CHANGES often like share price
Response to client goes from the same JSP which client requested.Response to client goes from a different JSP
When control returned to including file, extra activity like including another JSP file can be done.As control never returns, no extra activity can be done in including file.

Question 8

Scripts- Server Side

Appeared in Year: 2004

Question

MCQ▾

Which of the following cannot be used as the scope when using a JavaBean with JSP?

Choices

Choice (4)

a.

Session

b.

Response

c.

Request

d.

Application

Answer

b.

Explanation

Scope: represents the scope of the bean. It may be page, request, session or application. The default scope is page.

  • Page: specifies that you can use this bean within the JSP page. The default scope is page.
  • Request: specifies that you can use this bean from any JSP page that processes the same request. It has wider scope than page.
  • Session: specifies that you can use this bean from any JSP page in the same session whether processes the same request or not. It has wider scope than request.
  • Application: specifies that you can use this bean from any JSP page in the same application. It has wider scope than session.

So, response cannot be used as the scope when using a JavaBean with JSP.

Developed by: