java - How to include HTML in JSP? -
i've searched question, there answers, not question. here jsp code:
<body> <% if (manager.isvalid(request.getparameter("username"),request.getparameter("password"))){ out.print("<h1> welcome "); out.print(request.getparameter("username") + "</h1>"); } else { out.print("<h1> please try again </h1> <br />"); out.print("either username or password incorrect. please try again <br /> <br />"); } %> <%@ include file="loginform.html" %>
but instead of this, want include "loginform.html" in "else" block. how can it? of course doesn't work, you'll guess want :
<% if (manager.isvalid(request.getparameter("username"),request.getparameter("password"))){ out.print("<h1> welcome "); out.print(request.getparameter("username") + "</h1>"); } else { out.print("<h1> please try again </h1> <br />"); out.print("either username or password incorrect. please try again <br /> <br />"); include file="loginform.html" ; } %>
i show way, try below. can try else instead if
.
<body> <% int x = 10; if(x>10) { %> <%@include file="some.html" %> <% } %> </body>
Comments
Post a Comment