Solution:
<html>
<head>
<title>Welcome to Online Banking</title>
</head>
<body>
<% String user=request.getParameter("user"); %>
<H3>Welcome <%= (user==null) ? "to Online Banking" : user + " to Online Banking" %>!</H3>
<b>Enter name:</b>
<form method=get>
<input type="text" name="user" size=15>
<input type="submit" value="Submit name">
</form>
</body>
</html>
The output of the program is as shown in Figure 2.4 when the user name has not been entered, that is, user name = null.
Figure 2.4: Output of Welcome.jsp
When the user enters name in the text box and clicks on Submit button, the output appears as shown in Figure 2.5.Figure 2.5: Output of Welcome.jsp
0 nhận xét:
Post a Comment