步步为营

2006年4月8日

table 与 div的关系

table的宽度百分比取决于父对象的宽度,父对象常见为div,


常见错误

<div style="width:100%">
   
<table style="width;100%;margin:10px"
</div
>
这种情况下,table 肯定将获得div的全部宽度,不会因为margin而进行改变。所以要想保持美观,尽量不要在table上加margin, 正确写法如下:

<div style="width:100%;margin:10px">
   
<table style="width;100%"
</div
>


小经验,分享之

posted @ 2006-04-08 11:42 java门客 阅读(461) | 评论 (1)编辑 收藏

2005年10月25日

Generic Type

近日,碰到类似于“ ...raw type list..”字样的提示,研究发现,J2SE 5.0有了一个新的变化,就是generic概念,详细请看:
http://java.sun.com/docs/books/tutorial/java/javaOO/gentypes.html

问题自然就会得到答案。

提供一例:
假设你要建立一类Product的arraylist,代码应为:
List<Product> result = new ArrayList<Product>();
result.add(new Product());
以前的写法为:
List result = new ArrayList();
result.add(new Product());
其中奥妙看那篇文章吧。:)

posted @ 2005-10-25 14:22 java门客 阅读(147) | 评论 (0)编辑 收藏

2005年10月14日

UrlRewrite2.5.x 手册注解

1、run元素对应的class的方法必须为public

<run> element
Allows you to run a method on an object when a rule and it's conditions are matched.

Attribute Explanation 
class (default) The class you want to run a method on. Must be a fully qualified name. 
method (optional, default run) The method you want to run, the method must have the parameters (HttpServletRequest, HttpServletResponse) e.g. run(HttpServletRequest request, HttpServletResponse response) 
Note, if init(ServletConfig) or destroy() is found they will be run at when creating or destroying an instance.  
neweachtime (optional, default false) If you want new instance of the class to be created before running each time set to true. 

When the rule in the following example is matched, WorldServlet.goGet(HttpServletRequest, HttpServletResponse) will be invoked, the request will then be forwarded to /world-presentation.jsp.

    
<rule>
    
<from>^/world/[a-z]+/[a-z]+$</from>
    
<run class="com.blah.web.WorldServlet" method="doGet" />
    
<to>/world-presentation.jsp</to>
    
</rule>
Note, you can specify init-param's the same way you would for a servlet.

    
<run class="com.blah.web.MyServlet" method="doGet">
    
<init-param>
    
<param-name>someParamName</param-name>
    
<param-value>10</param-value>
    
</init-param>
    
</run>

posted @ 2005-10-14 20:10 java门客 阅读(250) | 评论 (0)编辑 收藏

仅列出标题  
<2024年4月>
31123456
78910111213
14151617181920
21222324252627
2829301234
567891011

导航

统计

常用链接

留言簿(1)

随笔档案

搜索

最新评论

阅读排行榜

评论排行榜