今天开发项目中发现:request.getRealPath(arg0); 报警告:
The method getRealPath(String) from the type ServletRequest is deprecated
request.getRealPath("") 这个方法已经不推荐使用了,那代替它的是什么方法呢?
...用心品味咖啡...
Posted by 唧唧 | tags:
今天开发项目中发现:request.getRealPath(arg0); 报警告:
The method getRealPath(String) from the type ServletRequest is deprecated
request.getRealPath("") 这个方法已经不推荐使用了,那代替它的是什么方法呢?
...Posted by 积极 | tags: vssplugin
今天用eclipse ganymede配置vssplugin_1.6.2的时候,在vss directry栏输后,提示Failed to create Ole Client. result = -2147221164,一直报错,很郁闷。
搞了半天,才发现VSS安装目录被我移动过了,注册表找不到执行文件了,重新安装Microsoft Visual SourceSafe 6.0后,问题得到解决!
VSS Plugin version 1.6.2 for Eclipse 3.3:http://vssplugin.sourceforge.net/
演示:点击评论栏目的用户名文本框 即可显示 验证码http://www.javawind.net/5b016f381a9e3f16011a9ebe0b570002.jhtml
------------------------------------------------------------------------------------
package org.javawind.servlet;
import java.awt.Color;
import java.awt.Font;
import java.awt.Graphics;
import java.awt.image.BufferedImage;
import java.io.IOException;
import java.util.Random;
import javax.imageio.ImageIO;
...
Posted by 唧唧 | tags: Hibernate proxool MySQL
注:本人用的MySQL是5.1版本,proxool0.9.0RC3,部分参数可能因为版本的差异而有所不同。如有疑问,请到论坛寻求帮助:http://www.javawind.net
1、在hibernate.cfg.xml同级目录下建立Proxool的配置文件 ProxoolConf.xml :
<?xml version="1.0" encoding="utf-8"?>
<something-else-entirely>
<proxool>
<alias>javawindPool</alias>
<driver-url>jdbc:mysql://localhost:3306/bbs?autoReconnect=true&useUnicode=true&characterEncoding=UTF-8</driver-url>
<driver-class>org.gjt.mm.mysql.Driver</driver-class>
...
Posted by 唧唧 | tags: many-to-one
本人的论坛程序(风信论坛)中 有用到这样的结构
post 帖子表 userInfo 用户表
------------------------------------------------------------------
pid (int) 主键 userId(int) 主键
..... .....
userId (int)
...
Posted by 唧唧 | tags: Eclipse Publishing Tomcat
Publishing failed
Removing obsolete files from server...
Could not clean server of obsolete files: XML document structures must start and end within the same entity.
XML document structures must start and end within the same entity.
Could not publish server configuration: XML document structures must start and end within the same entity..
XML document structures must start and end within the same entity.
准备做论坛的Rss,撰写输出rss xml 的jsp文件后,无法启动 Tomcat 调试运行,解决方法探索ing..
按照错误信息,其字面意思是叫我移除废弃或者不合法的文件,我检查了很多遍,都没有发现有什么文件不该存在,xml文件格式也都正确,Eclipse 检验整个项目没有报错呀。就是无法启动Servers下的Tomcat 6.0,而直接通过Monitor Tomcat却能正常启动 Tomcat 和运行项目,真是郁闷至极!
一直都没有发现主要是什么原因~
...
Posted by 唧唧 | tags: Resin 虚拟目录 域名
编辑Resin 安装目录下 的 conf/resin.conf
在 </cluster> 节点 的:
<!-- configures the default host, matching any host name -->
<host id="" root-directory=".">
前面插入:
<host id="www.javawind.net" root-directory="X:\*****\javawind.net\www">
<host-alias>www.javawind.net</host-alias>
<host-alias>javawind.net</host-alias>
<web-app id="/" root-directory="."/>
</host>
<host id="blog.javawind.net" root-directory="X:\*****\javawind.net\blog">
...
Posted by 唧唧 | tags: mysql root 密码
今天突然想登陆 办公室工作机的 MySQL Query Browser 发觉密码不正确,奇怪,我一直都是用空密码或者某一个特定密码的
尝试多次,还是不正确!不管是啥问题了,当作忘记密码来处理吧
Posted by 唧唧补充 | tags: DispatchAction
DispatchAction继承自Action类,它是一个抽象类,封装了一些基础方法,来解决使用一个Action处理多个操作的能力,这就是DispatchAction最大的用途,它可以帮助我们用一个Action类,封装一套类似的操作方法,节省了类的数目,同时也减轻了后期维护的困难。
DispatchAction中主要包括一下几个方法:
protected ActionForward dispatchMethodprotected java.lang.reflect.Method getMethodprotected java.lang.String getMethodName
DispatchAction在配置上于标准的Action稍有不同,就是要在Action配置中多一个parametr属性,这个属性将指导DispatchAction找到对应的方法,例如这样配置:
<action path="/saveSubscription"
type="org.apache.struts.actions.DispatchAction"
name="subscriptionForm" scope="request" input="/subscription.jsp"
parameter="method" />
parameter的属性值是可以任意起的,只要你记得在传参数的时候统一就可以了。比如我写了一个类似这样的Action,它继承自DispatchAction类,包含了三个操作方法,有Add(),Update(),Delete()。当我想要调用这个Action的Update操作时,提交的URL应该类似这样的:
http://localhost:8080/myapp/saveSubscription.do?method=update
就是这么简单,不过非常方面我们程序员了,开发中我感觉的确省了好多代码,至少以前的三个类文件变成了现在一个类了,而且在后期维护的时候感觉也是方便很多。
例解:
<html:form action="/insert.do?method=insertRecord" method="post">
这个请求中包含了参数method.这样的请求需要使用DispatchAction进行处理,参数中的方法就是自定义的DispatchAction类中的方法.
在Action中的应用(只要让其Action继承于DispatchAction类):
...
Posted by 唧唧 | tags: mysql 1146