-1

I'm working on some web pages. I created form by JSP/JSTL/servlet.

I have HTML, CSS, and JavaScript files on disk. My goal is add JSTL form to HTML page which consist some frame and import CSS, JavaScript files.

I try add HTML code to my JSP but it isn´t good idea.

Dave Newton
  • 158,873
  • 26
  • 254
  • 302
George
  • 1
  • 1

1 Answers1

1

On the contrary - your html must go in the JSP. It should be mixed with JSTL there. Everything else (java code) should go in servlets. Check this answer for more details.

Typically a page looks like this:

<html>
   <head><title><fmt:message key="title" /></title></head>
   <body>
       <c:forEach items="${results}" var="result">
           <h2>${result.title}</h2>
           <p style="margin-top: 10px;">${result.text}</p>
       </c:forEach>
   </body>
</html>
Community
  • 1
  • 1
Bozho
  • 588,226
  • 146
  • 1,060
  • 1,140