我应该如何使angular的入口点指向.jsp文件而不是index.html?
我希望文件的初始启动是一个.jsp文件,而不是index.html 我的angular.json我应该如何使angular的入口点指向.jsp文件而不是index.html?,angular,jsp,Angular,Jsp,我希望文件的初始启动是一个.jsp文件,而不是index.html 我的angular.json { "$schema": "./node_modules/@angular/cli/lib/config/schema.json", "version": 1, "newProjectRoot": "projects", "projects": { "secondpageapp": { "projectType": "application", "sc
{
"$schema": "./node_modules/@angular/cli/lib/config/schema.json",
"version": 1,
"newProjectRoot": "projects",
"projects": {
"secondpageapp": {
"projectType": "application",
"schematics": {},
"root": "",
"sourceRoot": "src",
"prefix": "app",
"architect": {
"build": {
"builder": "@angular-devkit/build-angular:browser",
"options": {
"outputPath": "dist/secondpageapp",
"index": "src/index.jsp",
"main": "src/main.ts",
"polyfills": "src/polyfills.ts",
"tsConfig": "tsconfig.app.json",
"aot": false,
"assets": [
"src/favicon.ico",
"src/assets"
],
"styles": [
"src/styles.css"
],
"scripts": []
},
"configurations": {
"production": {
"fileReplacements": [
{
"replace": "src/environments/environment.ts",
"with": "src/environments/environment.prod.ts"
}
],
"optimization": true,
"outputHashing": "all",
"sourceMap": false,
"extractCss": true,
"namedChunks": false,
"aot": true,
"extractLicenses": true,
"vendorChunk": false,
"buildOptimizer": true,
"budgets": [
{
"type": "initial",
"maximumWarning": "2mb",
"maximumError": "5mb"
},
{
"type": "anyComponentStyle",
"maximumWarning": "6kb",
"maximumError": "10kb"
}
]
}
}
},
"serve": {
"builder": "@angular-devkit/build-angular:dev-server",
"options": {
"browserTarget": "secondpageapp:build"
},
"configurations": {
"production": {
"browserTarget": "secondpageapp:build:production"
}
}
},
"extract-i18n": {
"builder": "@angular-devkit/build-angular:extract-i18n",
"options": {
"browserTarget": "secondpageapp:build"
}
},
"test": {
"builder": "@angular-devkit/build-angular:karma",
"options": {
"main": "src/test.ts",
"polyfills": "src/polyfills.ts",
"tsConfig": "tsconfig.spec.json",
"karmaConfig": "karma.conf.js",
"assets": [
"src/favicon.ico",
"src/assets"
],
"styles": [
"src/styles.css"
],
"scripts": []
}
},
"lint": {
"builder": "@angular-devkit/build-angular:tslint",
"options": {
"tsConfig": [
"tsconfig.app.json",
"tsconfig.spec.json",
"e2e/tsconfig.json"
],
"exclude": [
"**/node_modules/**"
]
}
},
"e2e": {
"builder": "@angular-devkit/build-angular:protractor",
"options": {
"protractorConfig": "e2e/protractor.conf.js",
"devServerTarget": "secondpageapp:serve"
},
"configurations": {
"production": {
"devServerTarget": "secondpageapp:serve:production"
}
}
}
}
}},
"defaultProject": "secondpageapp"
}
My index.jsp:
<html>
<head>
<script src="..\node_modules\@angular\common\bundles\common.umd.js"></script>
<script src="..\node_modules\@angular\compiler\bundles\compiler.umd.js"></script>
<script src="..\node_modules\zone.js\dist\zone.js"></script>
<script src="..\node_modules\reflect-metadata\Reflect.js"></script>
<script src="..\node_modules\rxjs\bundles\rxjs.umd.js"></script>
<script src="..\node_modules\@angular\core\bundles\core.umd.js"></script>
<script src="..\node_modules\@angular\platform-browser\bundles\platform-browser.umd.js"></script>
<script src="..\node_modules\@angular\platform-browser-dynamic\bundles\platform-browser-dynamic.umd.js"></script>
<title>First JSP</title>
</head>
<body>
<%@ page language="java" contentType="text/html; charset=US-ASCII" pageEncoding="US-ASCII"%>
<h3>Hi Pankaj</h3><br>
<strong>Current Time is</strong>:
<% out.print("Welcome"); %>
<app-root>
</app-root>
</body>
</html>
第一个JSP
嗨,潘卡吉
当前时间为:
在index.html中包含jsp页面的方法将不起作用,因为需求不同。请帮助我使用jsp页面作为angular应用程序的入口点。您运行
ng build--prod
,然后复制生成的index.html文件的所有内容并将其粘贴到jsp中?但说真的,为什么?实际上,我正在把一个项目从AngularJS转移到Angular8。因此,由于转换需要时间,发展不能停止。尝试在不干扰早期代码的情况下创建混合模型。运行ng build--prod
,然后复制生成的index.html文件的所有内容并将其粘贴到JSP中?但说真的,为什么?实际上,我正在把一个项目从AngularJS转移到Angular8。因此,由于转换需要时间,发展不能停止。尝试在不干扰早期代码的情况下创建混合模型。