我有一个家庭JSP页面。 我有一个家庭模板jsp页面。 现在我在主jsp中包含我的模板jsp页面,因此模板可以访问主干代码。
是否有可能我不必在主页中包含模板jsp页面,我可以在其他地方定义我的模板,但仍可从骨干代码访问。
I have a home JSP Page. I have a home template jsp page. Now i include my template jsp page inside the home jsp so the template are accessible for backbone code.
Is it possible i don't have to include the template jsp page in home page and i can define my template some other place but still accessible from backbone code.
最满意答案
您可以在项目中创建文件夹“template”,并在此文件夹中为每个模板创建一个不同的html文件。 在引导应用程序时,可以在内存中加载temlpate代码。 您仍然可以选择将所有模板放在一个文件中。 我不喜欢可读性。
看看这篇文章 。 这是一种组织模板的简洁方法,而且非常可维护!
You can create folder 'template' in your project and make a different html file in this folder for each template. You load the temlpate code in memory when you bootstrap your application. You can still choose to have all templates in one file. I prefer not to for readability.
Have a look at this article. It's a clean way to organize your templates and very mainainable!
更多推荐
发布评论