Practice Set 2
Practice Set 2
What is meaning of Synchronous request and Asynchronous request? Mention the working of AJAX
Write the ways using that we can deploy an application. Write the steps.
What is the meaning of HTTP Status Code. Explain codes 200, 500,400, 403 & 404.
With the help of Java script code block which checks the contents entered in a text box of a form. If
the test entered is in the lower case, convert to upper case using the builtin function.
Explain the use of JSP/ Servlet in web application. Write down the directory structure of the
application using a servlet.
How can we handle the exceptions in Java Server Pages (JSP)? Explain with a suitable example.
What is the use of JDBC drivers? Explain different types of JDBC drivers.
How can we create a dedicated error page in Java Server Pages (JSP)?
Why do we use client side scripting? Also explain the importance of server side scripting.
Write a Servlet which includes the content of another Servlet (ie data of other servlet is coming to
your servlet).
web.xml
<web-app>
<servlet>
<servlet-name>Config</servlet-name>
<servlet-class>ConfigDemo</servlet-class>
<init-param>
<param-name>username</param-name>
<param-value>studyglance</param-value>
</init-param>
</servlet>
<servlet-mapping>
<servlet-name>Config</servlet-name>
<url-pattern>/welcome</url-pattern>
</servlet-mapping>
</web-app>
ConfigDemo.java
// Import required java libraries
import java.io.*;
import javax.servlet.*;
import javax.servlet.http.*;
ServletContext
ServletContext object can be used to get configuration information from web.xml file. There is only
one ServletContext object per web application. If any information is shared to many servlet, it is
better to provide it from the web.xml file using the element.
ConfigDemo.java
// Import required java libraries
import java.io.*;
import javax.servlet.*;
import javax.servlet.http.*;
Outline the various http methods used to send an html form’s data to server in details.Explain with
the help of a program.
What is the utility of Spring boot in web programming? Explain its working
Write an Servlet / Java Server Pages (JSP) program to calculate Perimeter and area using post & get
method
Write a Servlet code snippet using PreparedStatement to insert data into a table in a MySQL/ Oracle
database.
What is the use of Spring and Spring Boot in web application. Explain with a suitable example
Write a Servlet/ Java Server Pages (JSP) program to validate user login. User data is available in
database
Write a Servlet/ Java Server Pages (JSP) program to maintain session using session object, Hidden
Form Field and URL Rewriting
Create an HTML form in which accept marks of 5 subjects and submit marks to a servlet. Calculate
the division of the students based upon following criterion
State with an example the various way to add JavaScript and CSS to HTML.
Write a Servlet/ Java Server Pages (JSP) program showing Page Navigation using Send redirect &
RequestDispatcher
Develop an application using AJAX and Java Server Pages (JSP) that contains html page that accept
email and check and display a message email is present in the database or not. Create an user and
store data in database
How do we use custom tag in Java Server Pages (JSP)? Formulate steps to create a custom tag.
Elaborate Document Object Model (DOM) with different JavaScript objects. Write a program to
show system information and navigation information
What is the meaning of implicit objects of Java Server Pages (JSP). Show the uses with a suitable
program.
Write a JSP/Servlet program using preparedStatement in entering data in MySQL/ Oracle table. Also
display the result
Assume four users user1, user2, user3 and user4 having the passwords pwd1, pwd2, pwd3 and pwd4
respectively. Write a servlet/ JSP for doing the following. Create a Cookie and add these four user
id’s and passwords to this Cookie. 2. Read the user id and passwords entered in the Login form and
authenticate with the values available in the cookies.
Design a table with the following fields: name, password, email-id, and phone number.
Write a program using Servlets or JavaServer Pages (JSP) to connect to the database, retrieve
data from the table, and display it. Additionally, implement functionality to insert user details
into the table when a new user registers by clicking the submit button on the registration
page.
Create a webpage that includes various form elements such as Text area, select, text box,
checkboxes, and radio buttons. Implement functionality using JavaScript to display the data entered
by the user.
Design a shopping cart for an apparel store with session tracking API.
Write a program of Servlet/ JSP in which pass three input using form element and find the greatest
on in main.jsp page. If the greatest number is even then send control to Even.jsp otherwise odd.jsp
Write a program of Servlet/ JSP in which pass three input using form element Name, Age and Marks.
Use cookie / session objects to maintain session and send data to third page and print all.