关闭

HTML(JSP)

117人阅读 评论(0) 收藏 举报

014、页面判断

     <c:choose>

               <c:when test="${typeId==10}">

                            <imgsrc="a.jpg"/>                                                              

               </c:when>

               <c:otherwise>

                            <imgsrc="b.jpg"/>

               </c:otherwise>

</c:choose>

013bootstrap字体图标

(1)添加fonts文件夹中的文件(5个);

     (2)<linkhref="http://apps.bdimg.com/libs/bootstrap/3.2.0/css/bootstrap.min.css"rel="stylesheet">

012textarea禁止拖动:textarea{outline:none;resize:none;}

011overflow:属性规定当内容溢出元素框时发生的事情。

说明:这个属性定义溢出元素内容区的内容会如何处理。如果值为 scroll,不论是否需要,用户代理都会提供一种滚动机制。因此,有可能即使元素框中可以放下所有内容也会出现滚动条。

visible  默认值。内容不会被修剪,会呈现在元素框之外。

hidden               内容会被修剪,并且其余内容是不可见的

scroll    内容会被修剪,但是浏览器会显示滚动条以便查看其余的内容。

auto      如果内容被修剪,则浏览器会显示滚动条以便查看其余的内容。

inherit  规定应该从父元素继承 overflow 属性的值。

010<td>内容居上

<td valign="top">

009、删除

<img style="cursor:hand"src="<%=SysPath%><%=ImgPath%>ico_delb.png"width="20px" height="20px" title="删除"onclick="wareDelete('<nested:write property="cmName"/>','<nested:write property="cmId"/>')"/>

<script type="text/javascript">

              // 声明商品全局变量cmId

              varid = null;

              functionwareDelete(cmName,cmId){

                            isConfirm("您确定删除"+cmName+" 吗?","isRemoveCommodity");

                            id= cmId;

              }            

              // 根据商品ID删除商品信息(假删除页面不显示)

              functionisRemoveCommodity(ret){

                            if(ret){// ret:true or false

                                          document.forms[0].action= "<%=SysPath%><%=FunctionPath%>.do?cmd=removeCommodity&cmId="+ id;

                                          document.forms[0].submit();

                                          sc_dataInit(true);

                            }

              }

</script>

008、<textarea>标签

<textarea style="border-bottom: 0pxsolid; border-left: 0px solid; border-right: 0px solid; border-top: 0px solid; background-color:#FFEFDB " cols="60" rows="5" >

                <nested:writeproperty="cmContent"/>

</textarea>

007、div内容居中

.centerss {

height: 300px;

width: 500px;

margin: auto;

background-color: #CCC;

text-align: center; 

line-height:300px;

}

简写:<divstyle="width: 950px;margin: auto;text-align: center;"></div>

006、循环遍历(乌什网站)

<c:choose>

<c:whentest="${fn:length(noticeAfficheList)==0}">

<tr><td><center>暂无信息</center></td></tr>

</c:when>

<c:otherwise>

<c:forEachvar="notice" items="${noticeAfficheList}">

              <tr>

<td height="50"align="left" height="40" >

<ahref="noticeDetailed.do?recordid=${notice.recordid}"class="yjgl" >

<span style="white-space:nowrap;overflow:hidden;text-overflow:ellipsis;width:400px;margin-left:0px;" title="${notice.articletitle}">

                             ${notice.articletitle}

                        </span>

                     </a>

</td>

              <tr>                                                                                                       

</c:forEach>

</c:otherwise>

</c:choose>

005、引用外部文件

<iframeframeborder="no"marginwidth="0"marginheight="0"width="600"height="700"scrolling="auto"frameborder="0"

style="filter:chroma(color=#ffffff)"src="${path}/resource_zhengwu/${noticeAfficheDetailed.siteid}/${noticeAfficheDetailed.recordid}/index.html"/></iframe>

<m:Renderfile="../data1/file/resource_zhengwu/${noticeAfficheDetailed.siteid}/${noticeAfficheDetailed.recordid}/index.html"/>

004、计算机(一个按钮执行多个不同事件)

<form name="f"method="post" class="calculatorForm">

第一个数:<inputtype="text" name="num1"/><br/>

第二个数:<inputtype="text" name="num2"/><br>

<inputtype="button" value="加" onclick="javascript:document.f.action='calculator/calculator_add';document.f.submit();"/>

<inputtype="button" value="减"onclick="javascript:document.f.action='calculator/calculator_sub';document.f.submit();"/>

<inputtype="button" value="乘" onclick="javascript:document.f.action='calculator/calculator_mul';document.f.submit();"/>

<inputtype="button" value="除"onclick="javascript:document.f.action='calculator/calculator_div';document.f.submit();"/>

</form>

003、添加日历控件

<script type="text/javascript"src="${pageContext.request.contextPath}/JS/My97DatePicker/WdatePicker.js"></script>

<input type="text"  value="time" name="time"onfocus="WdatePicker()"/>

002、struts2标签格式化显示日期

<%@ taglib uri="/struts-tags"prefix="s"%>

<s:iteratorvalue="#request.houseList" var="house">

<s:date name="#house.Date"format="yyyy-MM-dd"/>

</s:iterator>

001、分页信息

     前端:

              <tdalign="right" valign="bottom">

                            <c:iftest="${fn:length(List)>0}">

                                          <formaction="shoplist.do" method="post"name="formPage">

                                                                                                  <inputtype="hidden" value="${lv1}" name="lv1" >

                                                                                                  <c:iftest="${lv2 != null}">

                                                                                                                <inputtype="hidden" value="${lv2}" name="lv2">

                                                                                                  </c:if>

                                                                                                  <inputtype="hidden" value="${tag}" name="tag">

                                                                                                  <inputtype="hidden" value="${pricesort}"name="pricesort">

                                                                                                  <inputtype="hidden" value="${highprice}"name="highprice">

                                                                                                  <inputtype="hidden" value="${lowprice}"name="lowprice">

                                                                                                 

                                                                                                  <pe:ViewName/>

                                                                                                  <pe:combinedPagetotal="${recordNumber}" pageSize="${pageSize}"script="true" />

                                                                                                                <tablewidth="100%" border="0" cellpadding="0"cellspacing="0">

                                                                                                                              <tr>

                                                                                                                                            <tdheight="25">

                                                                                                                                                          <inputtype="hidden" id="Fenye_pageNumber"value="<pe:PageNumber />" />

                                                                                                                                            </td>

                                                                                                                                            <tdid="ps" style="color: gray;">当前第&nbsp;<span

                                                                                                                                                          style="color:red;"><pe:PageNo/>

                                                                                                                                            </span>&nbsp;页&nbsp;共&nbsp;<spanstyle="color:red;"><pe:PageNumber />

                                                                                                                                            </span>&nbsp;页&nbsp;<spanstyle="color:red;"><pe:RecordNumber />

                                                                                                                                            </span>&nbsp;条记录 <pe:GotoPagetype='1' insertContent="class='xxx'"

                                                                                                                                                                        insertContent2="class='yyy'" />&nbsp; <pe:TopPage type='2'

                                                                                                                                                                        value="Page.TopPage"/>&nbsp; <pe:PrevPage type='2'

                                                                                                                                                                        value="Page.PrevPage"/>&nbsp; <pe:NextPage type='2'

                                                                                                                                                                        value="Page.NextPage"/>&nbsp; <pe:BottomPage type='2'

                                                                                                                                                                        value="Page.BottomPage"/>&nbsp;</td>

                                                                                                                              </tr>

                                                                                                                </table>

                                          </form>

                            </c:if> 

</td>

              后台:

              ShopListActionextends PagableQueryAction execute {

                            this.setPageSize(9);

                            context.setState(0);//<paramname="success">landScape/NewLandScapeMerList</param>

              }

              PagableQueryActionextends IbsQueryAction(系统)

              privateint pageSize = 10;

              publicvoid execute(Context paramContext) throws PeException {

                            Objectobject = queryRecordNumber(localMap);

                            paramContext.setData("recordNumber",object);                  //记录总数

                            IntegercurrentIndex = paramContext.getInteger("currentIndex");     // 当前记录行号

                            paramContext.setData("currentIndex",currentIndex);

                            NumberlocalNumber = resolvePageSize(paramContext);            // 每页数量

                            paramContext.setData("pageSize",localNumber);

                            paramContext.setData("List",queryForList(localMap, j, localNumber.intValue()));

              }

              protectedObject queryRecordNumber(Map paramMap) {

                            returngetSqlMap().queryForObject(this.queryCountSql, paramMap);

              }

0
0

查看评论
* 以上用户言论只代表其个人观点,不代表CSDN网站的观点或立场