角度2:使用.jsp文件作为组件的模板 [英] Angular 2: Using a .jsp file as template for component

查看:66
本文介绍了角度2:使用.jsp文件作为组件的模板的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我想将jsp用作angular2组件的模板文件. 在angular-cli服务器上运行项目时,出现编译错误,这是预期的:

I want to use a jsp as a template file for an angular2 component. When running the project on angular-cli server I get a compilation error, which is expected:

http://imgur.com/a/j1qPR

但是后来我尝试将整个项目复制到tomcat的webapps文件夹中,并且角度代码不起作用(index.html不会显示来自app.component的文本,仅显示正在加载...".)

But then I tried copying the whole project to my tomcat's webapps folder, and the angular code doesnt work (index.html doesnt show the text from app.component, only "loading....").

您可能会说,对于angular2和编程而言,它相对较新.帮助将不胜感激.谢谢!

As you can probably tell, im relatively new to angular2 and programming in general. Help would be greatly appreciated. Thanks!

推荐答案

JSP或JavaServerPages是一种用于处理HTML并执行运行Tomcat或其他启用Java的Web服务器的服务器端渲染的技术.

JSP or JavaServerPages is a technology used to process HTML and do server side rendering running Tomcat or another Java enabled web server.

Angular是一个客户端框架,可将您的所有代码转换为JavaScript和HTML.

Angular is a client side framework that converts all your code to JavaScript and HTML.

要回答您的问题,不能将JSP页面用于Angular模板.

To answer your question, you cannot use JSP pages for Angular templates.

这篇关于角度2:使用.jsp文件作为组件的模板的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆