Question 1

You are required to write the code for sevlet which will take username and password from the html file and matches with database which contains two columns; one for username and other for password.

Providing correct information leads to welcome page otherwise to a login page again.

You are required to write the code for servlet only.

Question 2

Consider the following way for defining initialization parameters of servlet in web.xml.

<init-param>

<param-name> userName </param-name>

<param-value> admin </param-value>

</init-param>

<init-param>

<param-name> password </param-name>

<param-value> vu </param-value>

</init-param>

You are required to write the two ways for reading initialization parameters from web.xml and display its value on html file.

Question 3

You are required to write the XML equivalent tags for the following elements of JSP (Java Server Page).

1)

  <%!

      String str ;



      public String concatenateStr(String s1, String s2){

        return s1+s2 ;

      }

  %>

2)

  <%

      String s1= request.getParameter(“str1”);

      String s2= request.getParameter(“str2”);

      str = concatenateStr(s1, s2);

  %>

3)

<%@page import = “java.util.*” %>

Edited 3 Years Ago by mike_2000_17: Fixed formatting

This article has been dead for over six months. Start a new discussion instead.