Problems with elements order in JSP
Several days ago I started to learn Java EE and web development (firstly:
Tomcat, Servlets, JSP).
So now I have this JSP page code. As you can see, the header Hello World
with JSP stay before <% ... %> block.:
<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<%@ page import="java.util.*" %>
<html>
<body>
<h1 align="center">Hello World with JSP</h1>
<br>
<%
List styles = (List)request.getAttribute("styles");
for(Object style: styles){
response.getWriter().println("<br>try: " + style);
}
%>
</body>
</html>
But in result web page result from <% ... %> stay before the Hello World
with JSP header. Why?
P.S. Sorry for terminology but I'm really new in web development.
No comments:
Post a Comment