JSP template

zhaozj2021-02-16  71

In ASP.NET, User Control makes the page template into a new design idea. It is concerned about JSP these two days, but it seems that there is no ready-made technical statement, but indirect implementation can be, look down example.

Directory Structure: / - / Template - / Default - / Blue - / ...

Online: ... ...

String template = user.get ("template"); template = ((Template.Length () == 0)? "Default": template);

Out.flush (); Request.getRequestDispatcher ("/ Web-INF / TEMPLATE /" Template "/Post.jsp ".inClude (Request, Response);

...

This usage seems to be similar to that contains another web page, two important include methods in JSP:

<% @ Include file = "/ Web-inf / template / statuscheck.jsp"%>

However, it will be found that this template is actually a dynamic approach. The two commonly used methods are static, and most occasions are enough, but there are some cases more difficult. For the previous example, you have to contain different implementations for different user templates, and the static container method is very difficult.

P.S. When you entered, you feel a bit problem here, and all of all my spare brackets are automatically converted into HTML code, even if I entered & lt; & gt; nor. In this way, those examples will run behind. Finally, I have to use the whole corner. Not only do this, add something such as XML. Smelly :-(

转载请注明原文地址:https://www.9cbs.com/read-16719.html

New Post(0)