Scripts- Server Side [Computer Associates Placement]: Sample Questions 3 - 3 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 3

Appeared in Year: 2004

Question MCQ▾

Generally Servlets are used for complete HTML generation. If you want to generate partial HTMLs that include some static text (This should not be hard coded in Servlets) as well as some dynamic text, what method do you use?

Choices

Choice (4)

a.

Not possible to generate incomplete HTMLs using servlets.

b.

JSP code in HTML

c.

Service includes

d.

Question does not provide sufficient data or is vague

Edit

Answer

b.

Explanation

  • JavaServer Pages (JSPs) technology is an extension of Java servlet technology and combines HTML and Java code into a single file.
  • While Java servlet technology focuses on Java classes capable of generating HTML output with PrintWriter. println () statements, JSP technology abstracts this concept to a higher level.
  • With JavaServer Pages, a Web developer can write static HTML pages and simply add Java code in those sections of the page that need to be dynamically generated.
  • While this flexibility enables rapid development of simple Web applications, it can be abused, resulting in unnecessarily complex applications that are difficult to maintain, reuse, and enhance.