cerulean

**.jsp?param=1
那么request.getParameter("param")就可以勒!
原来用request.getAttribute死活不行,以为必须得用form传递呢,敢情getParameter就行~~

所以如果想只用jsp页面的话,可以这样子做:
hello.jsp:
function hello(name)
{
    sayHello(name);
}

function sayHello(id)
{
    window.location
="sayHelloCommit.jsp?id="+id;
}

sayHelloCommit.jsp:
<%@ page contentType="text/html;charset=gb2312"%>
<%
String str = (String) request.getParameter("id");
//To Something using the "str"
//redirect to a page
response.sendRedirect(
"hello.jsp");
%>

posted @ 2007-08-13 16:51 cerulean 阅读(665) | 评论 (0)编辑 收藏
more *.log | grep keywords

vi一个写有中文内容的文件,只能看到其unicode。more该文件就可以看到中文内容。
当keywords中包含空格时,需要用""将keywords扩起来。
 
posted @ 2007-08-02 17:19 cerulean 阅读(306) | 评论 (0)编辑 收藏
如题
posted @ 2007-08-01 09:41 cerulean 阅读(2118) | 评论 (0)编辑 收藏

Linux和windows下,文件中的换行符好像是不同的,当在windows下用UE打开一来自linux的文件时,好像会问你是不是要转换到DOS格式什么的。在eclipse中打开代码时,有时也会遇到类似的问题,尤其是.xml文件。
今天在看weka的网站时,无意看到在eclipse中有一个设置貌似是专门用来做这个的:
eclipse->Window -> Preferences -> General -> Editors 里面有一个"New text file line delimiter",可以在other中选择Unix。

posted @ 2007-07-26 10:27 cerulean 阅读(746) | 评论 (0)编辑 收藏
7种武器
array/String/HashMap
regular expressions
debug
two programming languages
one IDE
SQL
software idea
posted @ 2007-07-25 22:21 cerulean 阅读(229) | 评论 (0)编辑 收藏
小心仔细的使用静态变量,因为有的时候它表现的过于“静态”,而不符合习惯性的想法,容易引入不易发现的bug。
因为经常是在单次运行程序时还不会反映出来,只有在多次运行时才能显露效果。
posted @ 2007-07-25 22:20 cerulean 阅读(267) | 评论 (0)编辑 收藏

windows命令行支持的ftp命令,下载东西时默认是ASCII编码,于是一个.war文件下载后的文件大小就不大对,部署时tomcat也不认识,报出invalid header的错误。
因此用这个命令下载时需要转换成二进制。而如果用现成的FTP工具下载就不会有问题。

posted @ 2007-07-25 22:18 cerulean 阅读(311) | 评论 (0)编辑 收藏

以前天真的认为只要把两个tomcat的端口号修改成不同的就哦了呢,结果不行。
实际情况是(转自CSDN):
1.特别要注意:不要设置CATALINA_HOME
2.分别修改安装目录下的conf子目录中的server.xml文件:
a.修改http访问端口(默认为8080端口),将8080修改为tomcat不在使用的端口号。此处所设的端口号即是以后访问web时所用的端口号。
b.修改Shutdown端口(默认为8005端口),将8005修改为没有在使用的端口号,例如8055。
c.修改8009端口,将8009修改为没有在使用的端口号,例如8099
(注意:两个文件中对应的端口号要不一样)
3.依次启动两个tomcat。

另外,因为打开了axis2的SOAPMonitor,今天不知道怎么回事儿monitor页面无法正常显示了,tomcat启动时也报出了address in use:5001的错误。一开始以为是两个tomcat的问题,后来才意识到是SOAPMonitor的端口冲突了(也不知道是和谁冲突了。。。)反正改吧:
webapps/axis2/WEB-INF/web.xml
<init-param>
          <param-name>SOAPMonitorPort</param-name>
          <param-value>5011</param-value>
</init-param>
把原来的5001改成比如5011就哦了。

posted @ 2007-07-25 22:15 cerulean 阅读(1332) | 评论 (0)编辑 收藏
用myeclipse创建web工程时,向web.xml文件中添加一些taglib的时候,总会报错,不过不影响使用。
在网上查了一下,好像是web.xml文件头格式的问题,最简单的解决方法是多加一个<jsp-config>标签,以struts标签为例:
<jsp-config>
<taglib>
      
<taglib-uri>/WEB-INF/struts-html</taglib-uri>
      
<taglib-location>/WEB-INF/struts-html.tld</taglib-location>
  
</taglib>
  
  
<taglib>
      
<taglib-uri>/WEB-INF/struts-bean</taglib-uri>
      
<taglib-location>/WEB-INF/struts-bean.tld</taglib-location>
  
</taglib>
  
  
<taglib>
      
<taglib-uri>/WEB-INF/struts-logic</taglib-uri>
      
<taglib-location>/WEB-INF/struts-logic.tld</taglib-location>
  
</taglib>
</jsp-config>
posted @ 2007-04-15 10:13 cerulean 阅读(1792) | 评论 (2)编辑 收藏
在web.xml中,会将HTTP的404错误导向一个错误页面:
<error-page>
    
<error-code>404</error-code>
    
<location>/errors.jsp</location>
</error-page>

但是今天发现随便访问一个不存在页面时,并没有如预期的一样出现自定义的错误页面。在网上查了一下,原来是IE对于内容非常少的自定义错误页面是不会显示出来的,而firefox就没有问题。
于是,把错误页面的内容多加了几行字,就可以了。
posted @ 2007-04-15 10:04 cerulean 阅读(360) | 评论 (0)编辑 收藏
仅列出标题
共6页: 上一页 1 2 3 4 5 6 下一页 

导航

<2024年5月>
2829301234
567891011
12131415161718
19202122232425
2627282930311
2345678

统计

常用链接

留言簿(3)

随笔分类

随笔档案

搜索

最新评论

阅读排行榜

评论排行榜