Configuration reference

Add a constant element to your struts config file to change the value of a configuration setting, like:

<constant name="struts.convention.result.path" value="/WEB-INF/mytemplates/"/>
NameDefault ValueDescription
struts.convention.action.disableJarScanningtrueScan jar files for actions
struts.convention.action.packagesAn optional list of action packages that this should create configuration for (they don't need to match a locator pattern)
struts.convention.result.path/WEB-INF/content/Directory where templates are located
struts.convention.result.flatLayouttrueIf set to false, the result can be put in its own directory: resultsRoot/namespace/actionName/result.extension
struts.convention.action.suffixActionSuffix used to find actions based on class names
struts.convention.action.disableScanningfalseScan packages for actions
struts.convention.action.mapAllMatchesfalseCreate action mappings, even if no @Action is found
struts.convention.action.checkImplementsActiontrueCheck if an action implements com.opensymphony.xwork2.Action to create an action mapping
struts.convention.default.parent.packageconvention-defaultDefault parent package for action mappins
struts.convention.action.name.lowercasetrueConvert action name to lowercase
struts.convention.action.name.separator-Separator used to build the action name, MyAction -> my-action. This character is also used as the separator between the action name and the result in templates, like action-result.jsp
struts.convention.package.locatorsaction,actions,struts,struts2Packages whose name end with one of these strings will be scanned for actions
struts.convention.package.locators.disablefalseDisable the scanning of packages based on package locators
struts.convention.exclude.packagesorg.apache.struts.*,
org.apache.struts2.*,
org.springframework.web.struts.*,
org.springframework.web.struts2.*,
org.hibernate.*
Packages excluded from the action scanning
struts.convention.package.locators.basePackageIf set, only packages that start with its value will be scanned for actions
struts.convention.relative.result.typesdispatcher,velocity,freemarkerThe list of result types that can have locations that are relative and the result location (which is the resultPath plus the namespace) prepended to them
struts.convention.redirect.to.slashtrueA boolean parameter that controls whether or not this will handle unknown actions in the same manner as Apache, Tomcat and other web servers. This handling will send back a redirect for URLs such as /foo to /foo/ if there doesn't exist an action that responds to /foo

在设置 Vue.js 项目并使用 npm 脚本进行开发、构建、代码检查和配置时,通常依赖于 Vue CLI 提供的工具链。以下是完整的流程和常用命令的说明: ### 安装 Vue CLI 并创建项目 首先确保你的开发环境中已安装 Node.js 和 npm,因为 Vue CLI 依赖于它们来运行和管理项目依赖[^1]。安装 Vue CLI 可以通过 npm 执行以下命令: ```bash npm install -g @vue/cli ``` 创建新项目时,可以通过交互式界面选择 Vue 版本和其他功能特性。例如选择 Vue 3.x 版本并手动选择功能: ```bash vue create my-project ``` 在交互界面中可以选择 Babel、Router、CSS 预处理器、Linter 等功能,并指定 Vue.js 的版本[^3]。 ### 使用 npm 脚本管理项目 Vue CLI 项目默认在 `package.json` 中提供了一些常用的 npm 脚本,用于开发、构建、代码检查等操作。以下是这些命令的说明: #### 启动开发服务器 使用以下命令启动本地开发服务器,该命令会自动编译项目并在浏览器中打开: ```bash npm run serve ``` 执行该命令时,npm 会临时将 `node_modules/.bin` 目录添加到系统路径中,以便调用 Vue CLI 提供的 `vue-cli-service` 工具[^2]。 #### 构建生产环境版本 当项目开发完成,准备部署到生产环境时,可以运行以下命令进行构建: ```bash npm run build ``` 该命令会将项目打包为优化后的静态资源,通常输出到 `dist` 目录中。 #### 代码检查与格式化 如果项目中集成了代码检查工具(如 ESLint),可以通过以下命令对代码进行静态分析: ```bash npm run lint ``` 该命令会根据配置文件(如 `.eslintrc.js` 或 `package.json` 中的 ESLint 配置)对代码进行检查,并输出错误或警告信息[^4]。 ### 项目配置 Vue CLI 项目支持通过专用配置文件或 `package.json` 存放配置。例如,Babel、ESLint、PostCSS 等工具的配置可以分别放在 `.babelrc`, `.eslintrc.js`, `postcss.config.js` 等文件中,也可以统一写入 `package.json`。通常推荐使用专用配置文件以提高可维护性[^4]。 ### 常见问题与解决方案 - **命令未找到**:如果执行 `npm run serve` 出现错误,确认是否已正确安装项目依赖。可尝试运行 `npm install` 来安装所有依赖包。 - **版本冲突**:如果项目依赖的 Vue.js 或其他插件版本不兼容,可以在创建项目时明确选择版本,或手动修改 `package.json` 中的版本号后运行 `npm install`。 ---
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值