PtStore学习注意事项
来源:互联网 发布:第十届华人网络春晚 编辑:程序博客网 时间:2024/06/05 18:49
一、开发环境搭建:
- eclipse安装插件:
- maven:
- 下载maven包;
- 配置环境变量只想maven的bin目录;
- 需要eclipse在Preference里面:maven-UserSetting的第一个选项,UserSetting,配置stting.xml的位置为maven的conf目录下。
- filesync:可以将开发目录的文件自动同步到指定的文件夹(如服务器的web目录)。在eclipseMarket里面查找安装,安装后,点击工程项目,右键,选择属性--fileSynchronization,里增加folder选项。
- jrebel插件:参考网址http://blog.csdn.net/lzz313/article/details/6681590--------还没有搞定
- velocity:参考网址:http://ilovejavaforever.iteye.com/blog/557908
- 2
二、应用环境搭建:
- 利用maven生成项目目录:
mvn archetype:create -DgroupId=org.coderj.webx -DartifactId=webx-demo -DarchetypeArtifactId=maven-archetype-webapp -Pexternal
- pom.xml:用来构建项目,项目中需要的各种plugin、依赖包、依赖关系在此定义,分别定义:properties、dpendeces、dpendeceMangement 、plugin等
- web.xml:项目的原始配置根目录,定义项目必要的配置,以及引入jar读取webx.xml以及webx-*.xml
com.alibaba.citrus.webx.context.WebxContextLoaderListener //用来引入webx.xml以及/WEB-INF/webx-*.xml
com.alibaba.citrus.webx.servlet.SetLoggingContextFilter----log4j日志的相关
- webx.xml:配置webx的相关项目,各种*.xml从此引入。
- ---common/webx-component-and-root.xml:定义各种mapping,例如jsp\vm的只想,以及layout\screen等指向;
- ---common/pipeline-exception.xml:设置异常相关,例如跳转页面等。
- ---common/resources.xml:设置web的根目录、图片路径、模板路径、classpath、webroot、上传路径等。
三、学习笔记
1、ibatis,中写xml,在每个sql语句中,可以指定类,参数是parameterClass=‘类名’,类在dal.dataobject里面定义。在sql语句调用类的属性,用 #属性名#调用。
2、增加一个对象(Inventory)
- 增加resource/sqlmal/Inventory.xm---定义Inventory的SQL语句
- resource/sqlmap-config.xml增加引入sqlmap中的xml
- com.alibaba.sample.petsotre.dal.dataobject增加Inventory.java定义类
- com.alibaba.sample.petstore.dal.dao增加InventoryDao.java
- com.alibaba.sample.petstore.dal.ibatis增加IbatisInvetoryDao.java
- resource/dal/dal-dao.xml中增加invetoryDao的Bean注入;
3:增加一个表单
- 在指定/admin/template/screen/目录增减.vm
- 在com.alibaba.sample.petstore.web.admin.module.screen增加相对应打开时候的动作。
- 在 com.alibaba.sample.petstore.biz.admin.ao增加对应的打开时对应的属性、方法等。供上面调用。
- 在WEB-INF的admin下webx2-form.xml增加Form对应的域校验
- 在WEB-INF的common/biz/biz-ao.xml增加ao的bean注入
4:调用顺序
web.xml-webx.xml-dal/dal-dao.xml---dal/dal-data-source.xml-----/petstore/dal/sqlmap-config.xml-------/sqlMapConfig/sqlMap
5:常见到的问题:
- Action无法找到doXXX,解决方法:这个时候看一下是不是Rundata的import引用错了;
- command。执行AO事,No bean named 'addCategory' is defined,解决方法:在WEB_INF中Common/biz/biz-ao中。增加bean注入。
- DAO无法找到,解决方法:需要在resource/dal/dal-dao.xml中进行配置
6:搭建新的系统遇到的问题
- 出现“mouleServivice” Bean无法找到:在WebX中有一个配置需要注意 <services:module-loader>
- 出现"ERROR - Undefined placeholders found in template:
- Template: WEB-INF/web.xml
- Descriptor: META-INF/autoconf/auto-config.xml
- Base URL: jar:file:/F:/Devlop/project/petstore/webxdemo/target/webxdemo.war!
/
---------------------------------------------------------------
-> petstore.loggingLevel
--------------------------------------------------------------- - "要注意看,是哪个palaceholder没有定义, 需要在webx.xml和auto-config.xml里面相匹配;另外“auto-config.xml”和“C;/user/用户名/antx.properties”里面的属性配置命名要一致
petstore.loggingLevel = warnpetstore.loggingRoot = ${petstore.work}/logspetstore.upload = ${petstore.work}/uploadpetstore.work = F:\\Devlop\\project\\petstore\\webxdemo\\targetwebxdemo.loggingLevel = warnwebxdemo.loggingRoot = ${webxdemo.work}/logswebxdemo.upload = ${webxdemo.work}/uploadwebxdemo.work = F:\\Devlop\\project\\petstore\\webxdemo\\target
petsotre 加载顺序WebApplicationContext[/WEB-INF/webx.xml][/WEB-INF/common/webx-component-and-root.xml][/WEB-INF/common/pipeline-exception.xml][/WEB-INF/common/resources.xml][/WEB-INF/common/biz/biz-ao.xml][/WEB-INF/common/biz/biz-delegate.xml][/WEB-INF/common/biz/biz-manager.xml][dal/dal-data-loader.xml][dal/dal-data-source.xml][dal/dal-dao.xml]开始加载SQL表的相关数据WebxComponents:initializationcompletedmdcmdc:initializationcompletedSetLoggingContextFilter-mdc:initializationcompletedInitializingfilter:webx\OpenedF:\Devlop\project\petstore\webxdemo\target\access.log[INFO]StartedJettyServer
- 遇到了“ContextLoader:com.alibaba.sample.petstore.web.common.PertstoreUser错误”,这个因为Web-inf下面的配置有问题,把log相关和form相关的配置拷贝就OK了。
- PtStore学习注意事项
- 学习注意事项
- CSS学习注意事项
- 学习jQuery的注意事项
- Java学习注意事项
- flex 学习注意事项
- OC学习笔记[注意事项]
- ant 的学习,注意事项
- 7月学习注意事项
- Linux学习注意事项
- 学习算法注意事项
- 学习指针注意事项
- 一、Linux 学习注意事项
- angular学习注意事项
- PHP学习注意事项积累
- Ionic学习注意事项01
- Linux学习注意事项
- java学习注意事项
- Struts2访问ServletAPI(Request, Session, ServletContext,Application,response)
- Bluetooth协议栈学习之SDP
- 直接拿来用!最火的Android开源项目
- 从服务器暴露数据
- jsp代码没有错,但是总是有红叉的解决方法
- PtStore学习注意事项
- How to programmatically click a WPF button
- The import java.util cannot be resolved
- hdu 1794
- HDU 1018 Big Number
- Hi3110 EV 100平台上Bluetooth的移植
- iOS ARC 内存泄露问题
- sqlserver 分页存储过程
- xercesc的一次调试