This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<!-- | |
isNew() : boolean - returns true if the session is new | |
getId() : String - returns the session id | |
invalidate() : void - invalidates this session and unbinds any object associated with it | |
setMaxInactiveInterval(long mills) : void - sets the idle time for a session to expire, the value is supplied in milliseconds | |
--> | |
<%@ page import="java.util.*" %> | |
<html> | |
<body> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<html> | |
<body> | |
<form action="student-checkbox-response.jsp"> | |
First name: <input type="text" name="fname" /> | |
<br/><br/> | |
Last name: <input type="text" name="lname" /> | |
<br/><br/> | |
<input type="checkbox" name="flang" value="java"/> Java | |
<input type="checkbox" name="flang" value="php"/> PHP | |
<input type="checkbox" name="flang" value="c"/> C |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<html> | |
<body> | |
<form action="student-radio-response.jsp"> | |
First name: <input type="text" name="fname" /> | |
<br/><br/> | |
Last name: <input type="text" name="lname" /> | |
<br/><br/> | |
<input type="radio" name="flang" value="java"/> Java | |
<input type="radio" name="flang" value="php"/> PHP | |
<input type="radio" name="flang" value="c"/> C |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<html> | |
<body> | |
<form action="student-dropdown-response.jsp"> | |
First name: <input type="text" name="fname" /> | |
<br/><br/> | |
Last name: <input type="text" name="lname" /> | |
<br/><br/> | |
<select name="country"> | |
<option>Brazil</option> | |
<option>France</option> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<html> | |
<body> | |
<form action="student-response.jsp"> | |
First name: <input type="text" name="fname" /> | |
<br/><br/> | |
Last name: <input type="text" name="lname" /> | |
<br/><br/> | |
<input type="submit" value="Submit" /> | |
</form> | |
</body> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<html> | |
<body> | |
<jsp:include page="my-header.html" /> | |
<p>Power Women's Attract L Black Running Shoes - 5 UK/India (38 EU)(5396053)</p> | |
<p>Power Women's Attract L Black Running Shoes - 5 UK/India (38 EU)(5396053)</p> | |
<p>Power Women's Attract L Black Running Shoes - 5 UK/India (38 EU)(5396053)</p> | |
<p>Power Women's Attract L Black Running Shoes - 5 UK/India (38 EU)(5396053)</p> | |
<p>Power Women's Attract L Black Running Shoes - 5 UK/India (38 EU)(5396053)</p> | |
<jsp:include page="my-footer.jsp" /> | |
</body> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<!--"request" object contains HTTP request headers and form data--> | |
<html> | |
<body> | |
<h3>JSP Built-In Objects</h3> | |
Request user agent: <%= request.getHeader("User-Agent") %> | |
<br/><br/> | |
Request language: <%= request.getLocale() %> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/*To create a package go to Java Resources/src right click and click new and choose "Package" and provide your package name*/ | |
/*To create your class right click on your created package, click New and choose "Class"*/ | |
package com.jspDemo.jsp; | |
public class FunUtils { | |
public static String makeItLower(String data){ | |
return data.toLowerCase(); | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<!--They allow us to declare a method in the JSP page. You can call the method in the same JSP page--> | |
<html> | |
<body> | |
<%! | |
String makeItLower(String data){ | |
return data.toLowerCase(); | |
} | |
%> | |
Lower case "Hello World": <%= makeItLower("Hello World") %> |