码迷,mamicode.com
首页 > 其他好文 > 详细

我的经验

时间:2015-02-04 16:27:59      阅读:141      评论:0      收藏:0      [点我收藏+]

标签:

1.<a>标签,链接后台追加多个参数,用什么间隔
答案:&或者&&都可以,如:product/findProduct?seriesId=40&&page=2
2.jsp如何显示富文本,或者其他文本编辑器自动生成的
答案:< s:property value ="#product.explain" escape= "false" />
3.debug模式不能进入断点
答案:
<!-- 把事务管理配置到action -->
     <aop:config proxy-target-class= "true">
           <aop:advisor advice-ref="txAdvice" pointcut="within(com.dingtai.plate.*.*.*)" />
     </aop:config >
配置事务出错,比如:路径
4.jquery更改form表单的action属性; 更改action  更改form的action
答案:$("#form").attr( "action", "${pageContext.request.contextPath}/users/updateIntegral" );
5.点击按钮后跳转到url里 button跳转url
<input value="标题" type="button" onclick="window.location=‘http://www.baidu.com‘"/>
打开新页面
<input value="标题" type="button" onclick=‘window.open("http://www.baidu.com")‘ />
转换本页面
<input value="标题" type="button" onclick=‘location.href("http://www.baidu.com")‘ />
6.带搜索的列表页如何解决没有数据表头问题?
答案:
<table>
               <s:if test= "#list.size() > 1">
                         <tr>
                              <td> 商品编号</td >
                         </tr>
                    </s:if>
               <s:iterator value= "list" >
                    <tr>
                         <td>< s:property value="sid" /></td>
                    </tr>
               </s:iterator>
           </table>
7.表单错误提示
< span id ="title_info" >* </span>
8.取消/去掉照片显示不出来的叉
答案: img标签的alt 属性是一个必需的属性,它规定在图像无法显示时的替代文本
9.数组转集合
String hql = "SELECT dingdanhao,chuli from Dingdan GROUP BY dingdanhao,chuli ";
           List list = dao.find(hql, page, pageSize);
           for (int i = 0; i < list.size(); i++) {
              Dingdan d = new Dingdan();
              Object[] obj = (Object[]) list.get(i);
              d.setDingdanhao((String)obj[0]);
              d.setChuli(( Integer)obj[1]);
               date.add(d);
          }
10.a标签的href属性自动增加当前action路径,如何取消
答案:这样写<a href= "http:// ${cg.url }" >${cg.url}</ a>
增加 http://
11.spring mvc + mybatis框架
Expected one result (or null) to be returned by selectOne(), but found: 2
答案:xml返回1条数据,但真实查询出来的是多条,程序不知到怎么办
12:
 
An exception occurred processing JSP page /WEB-INF/photoAlbumSystem/houtai/priceList.jsp at line 21
 
答案:foreach的item没有写el表达式
13.去掉ul的点  去掉li的点
答案:<ul >
     <li></li>
     </ul >
14.c标签动态多选框,checkbox
<c:forEach items= "${roles} " var="role" varStatus ="p">
    <input type= "checkbox" name="jieShouRenQun" value="${role.role} " id ="${p.index } "/> < label for ="${p.index } ">${role.role} </label>
 </c:forEach>
 
15.A configuration error occurred during startup.Please verify the preference filed with the prompt:Connect to VM.
答案:
1. 检查JDK,及Tomcat是否正确可用.
2. Tomcat,myeclipse使用的是不是同一个jdk.
3. 检查系统的防火墙是不是阻止了MyEclipse主程序访问网络.
16.String转date
用SimpleDateFormat来转换
SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
Date date = sdf.parse("2008-08-08 12:10:12");
具体请参考JDK API文档

另外 转换成DATE类型后并不会因为转换前的字符串是什么样子而不同 DATE类型的内部表示永远是一样的 所以你的第2条要求是没有意义的 数据库如何显示这个DATE类型只是数据库自己的关系 和DATE本身无关

如果你希望要自定义Date的显示 同样可是使用SimpleDateFormat类来实现
只需要
String date = sdf.format(new Date());
就可以了
17.Unterminated &lt;c:forEach tag
forEach没有结束或者没有开始
18.TypeError: ‘stepUp‘ called on an object that does not implement interface HTMLInputElement.
js代码有问题
19.sqlserver返回刚刚插入数据的id
答案: 插入后加入这个  OUTPUT inserted.id  
例如:
INSERT INTO 
[Beauty].[dbo].[loginhou]
([name], [password]) OUTPUT inserted.id
VALUES
(
N‘jiayonghui‘,
N‘sIx0zJUGNbCgNpUTDE3XMA== ‘
);
20.清空文本域的值
 $("#message").val("");
21.html下滑
//滑动刀bigf的地方  总消耗时间60毫秒
$("html,body").animate({scrollTop:$("#bigf").offset().top},60);
22.标签里英文或数字不会换行
style="WORD-WRAP:break-word"
23. 点击图片查看原图
/* 打开图片方法 */
          function refreshOpenImage(){
var length = $(".hh img").size();
for(var i=0;i<length;i++){
     $(".hh img:eq("+i+")").attr("onclick","window.open(this.src,‘图片查看‘,‘height=350, width=500,top=280,left=470‘);");
     }
}

我的经验

标签:

原文地址:http://www.cnblogs.com/jia1994/p/4272499.html

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!