Java Assignment
Answer the Questions(5X2=10)
1) What is the difference between doGet() and doPost() methods?
2) What are the main components of JDBC?
3) What are the different types of JSP tags?
4) How can you pass data from a servlet to a JSP page?
5) How can you manage sessions in servlets?
Choose the correct answer(5X1=5)
1) Which tag is used for declaring a variable in JSP?
a) <jsp:useBean>
b) <jsp:include>
c) <%! ... %>
d) <c:if>
2) How do you register a JDBC driver?
a) [Link]()
b) [Link]()
c) Both a and b
d) [Link]()
3) How do you create a button in JavaFX?
a) Button button = new Button("Click Me");
b) Button button = new Button();
c) Button button = [Link]("Click Me");
d) Button button = [Link]("Click Me");
4) How can you set an action for a button click in JavaFX?
a) [Link](() -> { /* code / });
b) [Link](event -> { / code / });
c) [Link](() -> { / code / });
d) [Link](() -> { / code / });
5) In a web application, when are servlets typically destroyed?
a) After every request
b) When the server shuts down or the servlet is undeployed
c) When the application starts
d) Every time a new request is received
Write a Servlet Program (10X1=10)
1) Create a servlet program to display Sathyabama Institute of Science and Technology?