现在的位置: 首页 > 综合 > 正文

使SHOP++支持 JDK1.5、Websphere 、Oracle

2014年02月06日 ⁄ 综合 ⁄ 共 2788字 ⁄ 字号 评论关闭

使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中增加了一个方法

复制代码

  1. private Cookie[] getCookie() {
  2.         Cookie[] cookie = null;
  3.         // String ss =
  4.         // "[testName='2,3'; testName2='[{'i':'4028488c2ce98f61012ce99126ec0001','q':1}]'; cartItemList='[{'i':'4028488c2ce9da61012ce9dbd3700001','q':1},{'i':'8a925d662cee2a9f012cee3f95430002','q':1}]\',\'q\':1}]'; JSESSIONID=52C7675E1DAE5464A8A2A8CC14C4D384]";
  5.         String cookieString = getRequest().getHeader("Cookie");
  6.         if(cookieString!=null&&cookieString.trim().length()>0){
  7.             int cIndex = cookieString.indexOf("cartItemList");
  8.             int eIndex = cookieString.indexOf(";", cIndex);
  9.             if (cIndex >= 0 ) {
  10.                 String cartItemListvalue = null;
  11.                 if(eIndex==-1){
  12.                     cartItemListvalue = cookieString.substring(cIndex
  13.                             + "cartItemList='".length(), cookieString.length()-1);
  14.                 }else{
  15.                     cartItemListvalue = cookieString.substring(cIndex
  16.                             + "cartItemList='".length(), eIndex - 1);
  17.                 }
  18.                 
  19.                 log.debug("cartItemListvalue:["+cartItemListvalue+"]");
  20.                 if (cartItemListvalue != null
  21.                         && cartItemListvalue.trim().length() > 0) {
  22.                     //cartItemListvalue = "{'i':'4028488c2ce9da61012ce9dbd3700001','q':1}";
  23.                     if(!cartItemListvalue.startsWith("[")){
  24.                         cartItemListvalue="["+cartItemListvalue+"]";
  25.                     }
  26.                     Cookie c = new Cookie("cartItemList", cartItemListvalue);
  27.                     cookie = new Cookie[1];
  28.                     cookie[0] = c;
  29.                 } else {
  30.                     cookie = new Cookie[0];
  31.                 }
  32.             } else {
  33.                 cookie = new Cookie[0];
  34.             }
  35.         }else{
  36.             cookie = new Cookie[0];
  37.         }
  38.         return cookie;
  39.     }

Oracle
使用SQLDeveloper2.x进行数据转换(3.x还不稳定)
修改几个默认的数据转换类型,主要为:

[font=&quot]

复制代码

  1. Bit[1]->Number[1,0]
  2. Double->float
  3. Date->timestamp

更改applicationContext配置,使得支持CLOB。
转换后的resouce表和oracle冲突,会被自动调整为resource_
以及Product对应的getProductAttributeMapStore表太长,被自动缩减表名
适当修改之。

另外,可适当修改SHOP++无需网页自动刷新,也非常简单,对于性能要求不高的小型应用足够了,还能省去管理员的工作量。

 

另外一个界面小BUG,那么多人用购物车不觉得奇怪吗?怎么没有商品名呢?,呵呵

${list.product.name}

抱歉!评论已关闭.