Mike Eghtebas
asked on
Adding comment to jsp page
Below I have a short jsp code:
<%@ page info="if Example JSP" %>
<html>
<head>
<title>Chapter 5 Examples</title>
</head>
<body>
<b>IF Statement Example ( Response ) <br /></b>
<br />
<%
int quantity = Integer.parseInt(request.g etParamete r("quantit y"));
if (quantity > 0) {
out.println("Thank-you for your order!!");
} else {
out.println("Sorry. please enter a possitive quantity");
}
%>
</body>
</html>
Q1: What is the first line for? <%@ page info="if Example JSP" %>
Q2. Could you add some comments to this code? I want to learn about your syntax and styke.
Q3: Is it a good idea to use XHTM not HTML?
Q4: Is the decelaration line shown below necessary to be included?
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
Thank you.
<%@ page info="if Example JSP" %>
<html>
<head>
<title>Chapter 5 Examples</title>
</head>
<body>
<b>IF Statement Example ( Response ) <br /></b>
<br />
<%
int quantity = Integer.parseInt(request.g
if (quantity > 0) {
out.println("Thank-you for your order!!");
} else {
out.println("Sorry. please enter a possitive quantity");
}
%>
</body>
</html>
Q1: What is the first line for? <%@ page info="if Example JSP" %>
Q2. Could you add some comments to this code? I want to learn about your syntax and styke.
Q3: Is it a good idea to use XHTM not HTML?
Q4: Is the decelaration line shown below necessary to be included?
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
Thank you.
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
>>Q1: What is the first line for? <%@ page info="if Example JSP" %>
As shivaspk the information get from Servlet.getServletInfo() method. This is very useful where a huge number of server programs are running on a server and you need to know about a particular servlet or JSP. otherwise no need .
other question are alreday gave gd explaintion by experts
As shivaspk the information get from Servlet.getServletInfo() method. This is very useful where a huge number of server programs are running on a server and you need to know about a particular servlet or JSP. otherwise no need .
other question are alreday gave gd explaintion by experts
ASKER
mplungjan,
No this is not homework. This is work related (small portion of what I do). I am lucky to have this chance.
No this is not homework. This is work related (small portion of what I do). I am lucky to have this chance.
ASKER
Thank you very much.
2) be aware of w3schools shortcomings: http://w3fools.com/