ackage HLPPDB;
import org.apache.commons.codec.base64.Base64;/**
 * 提供对 URL 进行处理的工具类
 */
public class queryBean
{
/**
 * 将 URL 参数据进行安全编码
 * @param s
 * @return
 */
public final static String safeRequestParameter(String s)
{
byte[] b = Base64.encode(s.getBytes());
StringBuffer sb = new StringBuffer();
for(int i = 0; i < b.length; i++)
{
sb.append("%" + Integer.toHexString(b[i]));
}
return sb.toString(); }
    /**
     * 对 URL 参数据进行安全解码
     * @param s
     * @return
     */
public final static String decodeSafeRequestParameter(String s)
{
return new String(Base64.decode(s.getBytes()));
}
}