团队协作配置 | 学习笔记

简介: 快速学习团队协作配置,介绍了团队协作配置系统机制, 以及在实际应用过程中如何使用。

开发者学堂课程【Java Web开发系列课程 - Struts2框架入门团队协作配置】学习笔记,与课程紧密联系,让用户快速学习知识。

课程地址:https://developer.aliyun.com/learning/course/537/detail/7294


团队协作配置

 

内容介绍:

一、常量配置方式

二、团队协作开发配置

三、package 配置

 

一、常量配置方式

1.乱码解决

<!-﹣乱码解决-->

く constant name =” struts .i18n. encoding ” value =" UTF -8"/>

2.自定义扩展名

く!-- 自定义扩展名-->

<constant   name ='”struts . action . extension "

value =" action ,, siggy “/>

3.友好的提示信息

<!-﹣设置开发模式-->

く constant name =" struts . devMode”value =" true "/>

4.设置配置文件修改后自动加载﹣推荐在开发中使用

< constant name =" struts . configuration . xmL . reload " value =" true "/>

5.常量配置方式二

在 src 下添加 struts . properties 配置文件


二、团队协作开发配置

1.通过 include 添加不同人员的配置文件

较正规配置:

config.sxt.struts  

config.sxt.hibernate

config.sxt.spring

会根据模块来选择

找不到 user 上,需要一个连接点接口(文件夹/目录)指向它,即

< include file =" config / sxt / struts / user . xmL "/>

<!-﹣配置 struts 属性﹣->

<乱码解决﹣->

< Constant name =" struts .i18n. encoding " value = UTF -8"/>

! --﹣设置开发模式﹣->

< constant name =" struts . devMode " value =" true "/>

constant name =" struts . configuration . xmL . reload " value =" true "/>

< include file=" config / sxt / struts / user . xmL "/>

2.user模块配置:

<xml version=1.0encoding=UTF-8?>

<!DOCTYPE struts PUBLIC

-// Apache Software Foundation//DTD Struts Configuration 2.3EN

http://struts.apache.org/dtds/struts-2.3.dtd>

く struts >

< package name =" user ” namespace ="/” extends =" struts - default >

く action name =" Login ” class =" cn . sxt . action . LoginAction ">

く result >/ success . jsp </ result >

く result name =" failed ">/ login . jsp </ result >

</ action >

</ package >

</ struts >


三、package 配置

く!-﹣包的名称自定义,可以配置多个包; namespace 命名空间:不同模块可以指定不同的空国

extends 值是直接或者间接继承 struts - default -->

< package name =" user ” namespace ="/ user " extends =" struts - defautt >

1.package 配置找到 name

<? xml  version ="1.0” encoding =" UTF-8"?>

<IDOCTYPE struts PUBLIC

"-//Apache Software Foundation // DTD Struts Configuration 2.3// EN "

http://struts. apache . org / dtds / struts -2.3.dtd">

<struts>

 <! -﹣包的名称自定义,可以配置多个包; namespace 命名空间:不同模块可以指在不同的空 -->

< package name =" user ” namespace ="/ user " extends =" struts - defauLt >

< action name =" Login ” class =" cn . sxt . action .LoginAction ">

<result >/ success jsp く/ result >

<result name =" failed ">/ login . jsp </ result >

</action>

</ package >

<struts>

2. 一个项目中需要管理很多类,aciton 名字不能重复,使用框架,遵循规则,可以使代码很规范,风格变得一致。风格一致可以使代码读起来方便不会乱,代码需要整齐干净。

要变得不同,在请求之前加上空间名称即可,加空间名称时需要注意加/,如果不加会找到命名空间下的jsp文件。

<body>

<form action =user/login.siggymethod=post>

用户名:<input type=textname=name/><br>

密码:<input type=passwordname=pwd/><br>

<input type=submitvalue=登录”/>

</form>

</body>

</html>

3.extends 继承

extends 值是直接或者间接继承 struts - default

核心包中有 struts-default.xml

Struts-default.xml:

<?Xml version="1.0" encoding =" UTF -8”?>

く--

/*

*$Id:struts-default .xml 1326928 2012-04-17 05:03:45Z iukaszlenart $

*

*Licensed to the Apache Software Foundation ( ASF ) under one or more contributor lcense agreements .See the NOTICE file distributed with thiS work for additional information

Regarding copyright ownership . The ASF licenses this file

to you under the Apache License,Version 2.0(the

"License”); you may not use this file except in compliance

With the License. You may obtain a copy of the license at

http://www.apache.org/licenses/LICENSE-2.e

" Unless required by applicable law or agreed to in Nriting

4.配置文件加载顺序

struts-default.xml--->struts-plugin.xml--->struts.xml

console中:Parsing configuration file 【struts-default.xml

Parsing configuration file 【struts-plugin.xml

Parsing configuration file 【struts.xml

<package name =struts-defaultabstract=true>

继承的是 struts-default,功能通过一系列 interceptor 来实现的

相关文章
|
5月前
|
前端开发 JavaScript 测试技术
探索现代前端工程化工具与流程:提升开发效率和项目质量
探索现代前端工程化工具与流程:提升开发效率和项目质量
探索现代前端工程化工具与流程:提升开发效率和项目质量
|
5月前
|
存储 前端开发 开发工具
前端开发中的Git版本控制:构建可靠的协作和代码管理
前端开发中的Git版本控制:构建可靠的协作和代码管理
77 0
|
5月前
|
前端开发 测试技术 持续交付
版本控制和团队协作:前端工程化的关键要素
版本控制和团队协作:前端工程化的关键要素
|
5月前
|
自然语言处理 前端开发 测试技术
前端工程化最佳实践:项目结构、代码规范和文档管理
前端工程化最佳实践:项目结构、代码规范和文档管理
|
1月前
|
图形学 开发工具 git
Unity与版本控制:游戏开发团队如何利用Git打造高效协作流程,实现代码管理的最佳实践指南
【8月更文挑战第31天】版本控制在软件开发中至关重要,尤其在Unity游戏开发中,能提升团队协作效率并避免错误。本文介绍如何在Unity项目中应用版本控制的最佳实践,包括选择Git、配置项目以排除不必要的文件、组织项目结构、避免冲突、规范提交信息以及使用分支管理开发流程,从而提高代码质量和团队协作效率。
46 1
|
5月前
|
安全 程序员 数据库
软件开发功能如何准备
该文档介绍了功能开发的准备工作,包括创建功能清单以明确项目需求,以及制定开发计划。在评估工期方面,程序员需要考虑需求分析、技术复杂度、任务分解、风险评估、团队协作和沟通等多个因素。准确的工期评估对于团队效率至关重要。
42 6
|
运维 测试技术 Linux
软件开发版本控制流程
软件开发版本控制流程
1045 0
软件开发版本控制流程
|
Linux 开发工具 开发者
软件开发之版本控制方式
软件开发之版本控制方式
软件开发之版本控制方式
|
监控 Kubernetes Devops
想学习一下如何成为一名DevOps开发人员
想学习一下如何成为一名DevOps开发人员
140 0
|
程序员
开发新概念:代码管理(代码框架)
开发新概念:代码管理(代码框架)
150 0
下一篇
无影云桌面