posts - 48, comments - 13, trackbacks - 0, articles - 0
  BlogJava :: 首页 :: 新随笔 :: 联系 :: 聚合  :: 管理

2009年9月24日

spket - http://www.spket.com/update

subclipse - http://subclipse.tigris.org/update

posted @ 2010-12-02 09:39 董锐 阅读(292) | 评论 (0)编辑 收藏

Tomcat启动时classloader加载顺序
  Tomcat的class加载的优先顺序一览  
  1.最先是$JAVA_HOME/jre/lib/ext/下的jar文件。  
  2.环境变量CLASSPATH中的jar和class文件。  
  3.$CATALINA_HOME/common/classes下的class文件。  
  4.$CATALINA_HOME/commons/endorsed下的jar文件。  
  5.$CATALINA_HOME/commons/i18n下的jar文件。  
  6.$CATALINA_HOME/common/lib   下的jar文件。  
  (JDBC驱动之类的jar文件可以放在这里,这样就可以避免在server.xml配置好数据源却出现找不到JDBC   Driver的情况。)  
  7.$CATALINA_HOME/server/classes下的class文件。  
  8.$CATALINA_HOME/server/lib/下的jar文件。  
  9.$CATALINA_BASE/shared/classes   下的class文件。  
  10.$CATALINA_BASE/shared/lib下的jar文件。  
  11.各自具体的webapp   /WEB-INF/classes下的class文件。  
  12.各自具体的webapp   /WEB-INF/lib下的jar文件。

posted @ 2010-11-03 11:31 董锐 阅读(1008) | 评论 (0)编辑 收藏

What this means is that leadership involves setting direction, communicating that vision passionately to those they work with, and helping the people they lead understand and commit to that vision. Managers, on the other hand, are responsible for ensuring that the vision is implemented efficiently and successfully.

posted @ 2010-08-23 16:29 董锐 阅读(445) | 评论 (0)编辑 收藏

I know how to send by jquery post method $.post("test.php", { name: "John", time: "2pm" } );

but what if my form field name is array

<input type=text name="n1[]" id="n1[]" value='12345">   <input type=text name="n1[]" id="n1[]" value="14454">  

how to send these 2 field value send to url by jquery post method?

 

You can pass in an array as a value in the object:

{name: 'John', 'nl[]': ['12345', '14454']}  

(This is documented at ajax but also works for post.)

 

var fields = $(":input").serializeArray();      $.post("test.php",fields);

from:http://stackoverflow.com/questions/1656267/how-to-send-multi-field-value-by-jquery-post

posted @ 2010-07-14 11:46 董锐 阅读(734) | 评论 (0)编辑 收藏

string.replace(new RegExp(oldString,"gm"),newString))

posted @ 2010-07-14 11:20 董锐 阅读(205) | 评论 (0)编辑 收藏

在网上看到解决方案是把注册表里(因为是windows操作系统)\HKEY_LOCAL_MACHINE\SOFTWARE\ORACLE 下的NLS_lang 的NA值修改为SIMPLIFIED CHINESE_CHINA.ZHS16GBK;
 但是我在操作的时候,只把Oracle目录下所有能找到的NLS_Lang值修改了,偏偏没有修改Oracle目录所对应的NLS_Lang值,导致一直测试不通过,始终报错,最后终于发现原来Oracle目录本身对应的NLS_lang值没有修改,修改过后,测试通过,成功!

posted @ 2010-01-14 14:45 董锐 阅读(13489) | 评论 (2)编辑 收藏

If you got this message: "Warning: Cannot modify header information - headers already sent by ...."
如果在执行php程序时看到这条警告:"Warning: Cannot modify header information - headers already sent by ...."

Few notes based on the following user posts:
有以下几种解决方法:

1. Blank lines (空白行):
Make sure no blank line after <?php ... ?> of the calling php script.
检查有<?php ... ?> 后面没有空白行,特别是include或者require的文件。不少问题是这些空白行导致的。

 

 

2. Use exit statement (用exit来解决):
Use exit after header statement seems to help some people
在header后加上exit();
header ("Location: xxx");
exit();

 

3. PHP has this annoying problem, if your HTML goes before any PHP code or any header modification before redirecting to certain page, it'll said "Warning: Cannot modify header information - headers already sent by ...." Basically anytime you output to browser, the header is set and cannot be modified.   So two ways to get around the problem:

3a. Use Javascript (用Javascript来解决):
<? echo "<script> self.location(\"file.php\");</script>"; ?>
Since it's a script, it won't modify the header until execution of Javascript.
可以用Javascript来代替header。但是上面的这段代码我没有执行成功... 另外需要注意,采用这种方法需要浏览器支持Javascript.

3b. Use output buffering (用输出缓存来解决):
<?php ob_start(); ?>
... HTML codes ...
<?php
... PHP codes ...
header ("Location: ....");
ob_end_flush();
?>
This will save the output buffer on server and not output to browser yet, which means you can modify the header all you want until the ob_end_flush() statement.   This method is cleaner than the Javascript since Javascript method assumes the browser has Javascript turn on.   However, there are overhead to store output buffer on server before output, but with modern hardware I would imagine it won't be that big of deal.   Javascript solution would be better if you know for sure your user has Javascript turn on on their browser.

就像上面的代码那样,这种方法在生成页面的时候缓存,这样就允许在输出head之后再输出header了。


————————————————————————————————————————————
结果最后还是这个问题:
原来是php.ini里面的配置出了问题,output_buffering参数默认为off的,现在将它设为”on”就OK了。

posted @ 2009-12-02 10:02 董锐 阅读(7393) | 评论 (1)编辑 收藏

1、要安装java jdk,安装tomcat
2、安装好apache,php
3、下载php-java-bridge_5.5.4_documentation.zip
4、解压缩php-java-bridge_5.5.4_documentation.zip
5、将解压缩后根目录下JavaBridge.war拷贝到tomcat服务器的webapp目录下
6、启动tomcat服务器
7、在php中使用java只需增加下面一行语句:
<php? require_once(http://127.0.0.1:8080/JavaBridge/java/Java.inc); ?>

可以了:
<php?
    $date=new Java('java.util.Date');
echo $date->getDate();
?>
运行通过,OK!

posted @ 2009-10-20 15:03 董锐 阅读(578) | 评论 (2)编辑 收藏

80端口被占用的解决方法:

cmd命令窗口
输入netstat -abn ->c:/port80.txt
然后到c盘port80.txt文件中找到占用80端口的程序pid,记下pid。打开任务管理器,点击“查看”/选择列,勾选“PID(进程标识符)”,然后单击“进程”标签,找到80端口对应的pid,就可以看到是那个程序占用的了,更改这个程序的port,再重启这个程序,使更改生效。

不管是Apache还是IIS都无法使用已被占用的端口。即每个端口只允许使用一次(一般指被一个服务程序所使用)。
如果系统内已安装IIS并使用了80端口(Http默认端口),再安装Apache,只要另选一个端口并不与其他应用冲突即可运行。例如可以将Apache监听的端口改为81或其他任何一个未被使用的端口。
Apache修改监听端口的方法为:
打开 httpd.conf
修改 Listen 80 为 Listen 81
Apache可以同时监听一个以上的端口实现多个Http服务
只要添一行 如 Listen 82 即可

posted @ 2009-09-24 14:18 董锐 阅读(1217) | 评论 (0)编辑 收藏