JSP基本知识

1.div模拟的hr

div.hr {
 margin-top:0px;
 margin-bottom:0px;
 border-top-width:1px;
 border-top-style:solid;
 border-top-color:#C7C7C7;
 background-color:#C7C7C7;
}

<hr>标签本身有缺陷

2.注意 <%@ page isELIgnored="true" %> 表示是否禁用EL语言,TRUE表示禁止.FALSE表示不禁止.JSP2.0中默认的启用EL语言。

EL表达式最常用在给JS方法传值。EL表达式不属于任何框架,属于SUN指定的一套标准。具体用法参照下面2个例子:

(1).<input type="button" οnclick="methodName('${formName.propertyName}')" />

(2).<script language="text/script">

                  alert("${formName.propertyName}");

      </script>

3.div { word-wrap: break-word; word-break: break-all; }

word-wrap控制是否换行,换行使用word-wrap: break-word;

word-break控制换行方式:break-all是英文断词。

综上:仅存在汉字的情况下,使用word-wrap: break-word;word-break:normal;

          存在超出长度的英文单词的情况下,使用word-wrap: break-word;word-break:break:-all;

word-wrap: break-word;word-break:normal;这种情况下,超出长度的英文依然会顶开容器边界

4.struts常用标签

例子:

①<logic:notEmpty name = "HDS_FC_B1_02SearchForm"  property="message">

②<logic:iterate id="detailBean"  name = "HDS_FC_B1_02SearchForm" property="downloadList" indexId="index">

其中indexId中的index可以拿去使用(在JAVA语言中)

③<logic:equal value="eng" name="user" property="languageCode">  

5.String path = request.getContextPath();
   String basePath = request.getScheme()+"://"+request.getServerName()+":"+request.getServerPort()+path+"/";(此时到达了webContent目录)

6.防止双重提交

var isClicked = false;
 var hmfw_isLoaded = false;

   function hmfw_checkScreenLoading(){
    if(hmfw_isLoaded){
      return true;
    }else{
      alert(document.getElementById("screenLoadMsg").value);
      return false;
    }
   }

 

function checkDoubleClick(obj) {
    if(downFlag){
     isClicked = false;
     return true;
    }
    if (isClicked) {
     alert(document.getElementById("doubleClickMsg").value);
     return false;
    } else {  
     isClicked = true;
     return true;
    }
   }

   function hmfw_onSubmit(obj){
    if(!hmfw_checkScreenLoading()){return false;}
    if(!checkDoubleClick()){return false;} 
    return true;
   }

οnsubmit="return hmfw_onSubmit(this);"

form的οnsubmit="return checkDoubleClick(this.id);"

7.禁止画面上右击按钮

document.oncontextmenu = new Function("return false;");

8.nowrap 属性规定表格单元格中的内容不换行。

<td width="6%" align= "center" nowrap="nowrap">

9.JS方法调用小规则(就近原则)

function method1(){}

function method1(){}

<input type="button" οnclick="method1();">

此时点击该按钮,将会调用位置上离它较近的method1()


 

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值