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> | |
<h3>Hello World</h3> | |
<p>The time on the server is <%= new java.util.Date() %></p> | |
</body> | |
</html> |
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> | |
Converting a string to uppercase: <%= new String("Hello World").toUpperCase() %> | |
<br><br> | |
25 x 4 = <%= 25*4 %> | |
<br><br> | |
Is 75 less than 69? <%= 75 < 69 %> | |
</body> | |
</html> |
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
<!--scriplets let us insert 1 to many lines of Java code. Scriplets make use of out.println() to print java code--> | |
<html> | |
<body> | |
<h3>Hello World</h3> | |
<% | |
for(int i=1; i<=5; i++){ | |
out.println("</br>I really luv2code: " + i); | |
} | |
%> | |
</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
<!--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") %> |
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
<!--"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
<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
<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> | |
<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-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 |
OlderNewer