<%@ taglib prefix="tiles" uri="http://tiles.apache.org/tags-tiles"%>
<%@ taglib prefix="s" uri="/struts-tags"%>
<%@ page contentType="text/html; charset=UTF-8"%>

<div class="container" style="margin-top: 47px;">
    <div class="row">
        <s:form action="headPicChangeDo" method="post" name="operation"
            enctype="multipart/form-data" theme="simple"
            cssClass="form-horizontal">
            <div class="form-group">
                <label class="col-sm-3 control-label">图片文件</label>
                <div class="col-sm-6">
                    <s:file name="myPic" size="50"
                        cssClass="form-control" />
                </div>
            </div>
            <div class="form-group">
                <label class="col-sm-3 control-label">预览</label>
                <div class="col-sm-6">

                <img id="image"  <s:if
                        test="#session.SESSION_EMPLOYEE.headPic != '' && #session.SESSION_EMPLOYEE.headPic != null"> src="downloadFile.action?fileKey=<s:property value='#session.SESSION_EMPLOYEE.headPic' />" </s:if> width="100" height="100" /><p></p>

                    <%-- <s:if
                        test="#session.SESSION_EMPLOYEE.headPic != '' && #session.SESSION_EMPLOYEE.headPic != null">
                        <img id="headPic" alt="头像"
                            src="downloadFile.action?fileKey=<s:property value='#session.SESSION_EMPLOYEE.headPic' />"
                            width="100" height="100" class="img-circle" />
                    </s:if>
                    <s:else>
                        <img id="headPic" alt="头像"
                            src="images/portrait.gif" width="100"
                            height="100" class="img-circle" />
                    </s:else> --%>
                </div>
            </div>

            <div class="form-group">
                <div class="col-sm-3"></div>
                <div class="col-sm-9">
                    <button type="submit" class="btn btn-primary btn-sm">
                        保 存</button>
                </div>
            </div>
        </s:form>
    </div>
</div>

<script>
    $(function() {
        $('input[type=file]').change(function() {
            var file = this.files[0];
            var reader = new FileReader();
            reader.onload = function() {
                // 通过 reader.result 来访问生成的 DataURL
                var url = reader.result;
                $("#image").attr('src', url);
            };
            reader.readAsDataURL(file);
        });
    })
</script>

 

posted @ 2016-12-27 10:40 微明Axel 阅读(2277) 评论(0) 推荐(0) 编辑
摘要: 需学习。。。 阅读全文
posted @ 2016-11-08 00:07 微明Axel 阅读(104) 评论(0) 推荐(0) 编辑
摘要: http://www.zhihu.com/question/19632311 阅读全文
posted @ 2016-09-06 22:14 微明Axel 阅读(125) 评论(0) 推荐(0) 编辑
摘要: 用单引号代替双引号来包含字符串,这样做会更快一些。因为PHP会在双引号包围的字符串中搜寻变量,单引号则 不会,注意:只有echo能这么做,它是一种可以把多个字符串当作参数的“函数”(兄弟连PHP编程:PHP手册中说echo是语言结构,不是真正的函数,故把函数加 上了双引号)。 1、如果能将类的方法定 阅读全文
posted @ 2016-09-06 22:05 微明Axel 阅读(107) 评论(0) 推荐(0) 编辑
摘要: 上一条:select * from 表 where 数据id<@当前显示数据id order by 数据_id asc) limit 1下一条:select * from 表 where 数据id>@当前显示数据id order by 数据_id desc) limit 1 mysql 里面不支持 阅读全文
posted @ 2016-07-21 11:06 微明Axel 阅读(1062) 评论(0) 推荐(0) 编辑
摘要: 如果要加载的东西比较简单,里面的没有复杂的数据和逻辑,可以使用load。如果要加载的页面自身有复杂的逻辑、操作,还是建议使用ifame,因为iframe里面可以引入自身的js和样式,而load引入的东西,还得使用主页面的js和样式进行控制。另外,应当注意,iframe加载的东西不用考虑主页面的任何东 阅读全文
posted @ 2016-07-06 15:30 微明Axel 阅读(1470) 评论(0) 推荐(0) 编辑
摘要: 7:30:起床。英国威斯敏斯特大学的研究人员发现,那些在早上5:22―7:21分起床的人,其血液中有一种能引起心脏病的物质含量较高,因此,在7:21之后起床对身体健康更加有益。打开台灯。“一醒来,就将灯打开,这样将会重新调整体内的生物钟,调整睡眠和醒来模式。”拉夫堡大学睡眠研究中心教授吉姆·霍恩说。 阅读全文
posted @ 2016-02-23 13:41 微明Axel 阅读(736) 评论(0) 推荐(0) 编辑
摘要: package com.dada.test; import java.text.SimpleDateFormat; import java.util.Calendar; import java.util.Date; /** * @author * @version * */ public class 阅读全文
posted @ 2016-02-01 09:46 微明Axel 阅读(3674) 评论(0) 推荐(0) 编辑
摘要: 判断 ArrayList size 是否为0判断 ArrayList size 是否为nullOR集合为空集合不为空or集合不为看空又OR首先说说判断字符串的问题:1、这样是从session中取出username的值,并且判断其是否为c,但是这样判断是不正确的,这样判断的话,根本判断不出来,要改成下... 阅读全文
posted @ 2015-12-02 12:00 微明Axel 阅读(308) 评论(0) 推荐(0) 编辑
点击右上角即可分享
微信分享提示