使SHOP++支持JDK1.5、Websphere 、Oracle
SHOP++作品极其优秀。
代码、架构、模式、模型如同界面一样清爽优雅。
JDK1.5
1。package net.shopxx.common;
Initializing类afterPropertiesSet方法
去掉@Overwrite
2。增加依赖包activation.jar
调试过程中。
在myeclipse调试用注意将Java Compiler降为1.5。
在windows->preferrences中将meclipse->servers->tomcat的jdk降为1.5。
Websphere
1.类似SystemConfigUtil中获取文件的方式在Websphere 会有问题:
String configFilePath = Thread.currentThread().getContextClassLoader().getResource("").toURI().getPath() + CONFIG_FILE_NAME;
修改成如下后,暂时在tomcat\websphere下正常
InputStream in = Thread.currentThread().getContextClassLoader().getResourceAsStream("shop.xml");
2.耽误时间较长的是:webshpere获取购物车cookie时,不支持解析带有 逗 号的cookie,在CartItemAction中增加了一个方法
复制代码
- private Cookie[] getCookie() {
- Cookie[] cookie = null;
- // String ss =
- // "[testName='2,3'; testName2='[{'i':'4028488c2ce98f61012ce99126ec0001','q':1}]'; cartItemList='[{'i':'4028488c2ce9da61012ce9dbd3700001','q':1},{'i':'8a925d662cee2a9f012cee3f95430002','q':1}]\',\'q\':1}]'; JSESSIONID=52C7675E1DAE5464A8A2A8CC14C4D384]";
- String cookieString = getRequest().getHeader("Cookie");
- if(cookieString!=null&&cookieString.trim().length()>0){
- int cIndex = cookieString.indexOf("cartItemList");
- int eIndex = cookieString.indexOf(";", cIndex);
- if (cIndex >= 0 ) {
- String cartItemListvalue = null;
- if(eIndex==-1){
- cartItemListvalue = cookieString.substring(cIndex
- + "cartItemList='".length(), cookieString.length()-1);
- }else{
- cartItemListvalue = cookieString.substring(cIndex
- + "cartItemList='".length(), eIndex - 1);
- }
-
- log.debug("cartItemListvalue:["+cartItemListvalue+"]");
- if (cartItemListvalue != null
- && cartItemListvalue.trim().length() > 0) {
- //cartItemListvalue = "{'i':'4028488c2ce9da61012ce9dbd3700001','q':1}";
- if(!cartItemListvalue.startsWith("[")){
- cartItemListvalue="["+cartItemListvalue+"]";
- }
- Cookie c = new Cookie("cartItemList", cartItemListvalue);
- cookie = new Cookie[1];
- cookie[0] = c;
- } else {
- cookie = new Cookie[0];
- }
- } else {
- cookie = new Cookie[0];
- }
- }else{
- cookie = new Cookie[0];
- }
- return cookie;
- }
|
Oracle
使用SQLDeveloper2.x进行数据转换(3.x还不稳定)
修改几个默认的数据转换类型,主要为:
[font="]
复制代码
- Bit[1]->Number[1,0]
- Double->float
- Date->timestamp
|
更改applicationContext配置,使得支持CLOB。
转换后的resouce表和oracle冲突,会被自动调整为resource_
以及Product对应的getProductAttributeMapStore表太长,被自动缩减表名
适当修改之。
另外,可适当修改SHOP++无需网页自动刷新,也非常简单,对于性能要求不高的小型应用足够了,还能省去管理员的工作量。
另外一个界面小BUG,那么多人用购物车不觉得奇怪吗?怎么没有商品名呢?,呵呵
${list.product.name}