欢迎访问悦橙教程(wld5.com),关注java教程。悦橙教程  java问答|  每日更新
页面导航 : > > 文章正文

JAVA日常,

来源: javaer 分享于  点击 21937 次 点评:251

JAVA日常,


jdk11生成jre

开始-运行-cmd

cd jdk路径

运行bin\jlink.exe --module-path jmods --add-modules java.desktop --output jre

div的隐藏显示


$("#total_number").toggle("slow");

$("#id").toggle();切换隐藏显示

<select>清空选项

jquary方法 $("#area").empty();

或者

$("#area").html(""); $("#area").find("option").remove();

select下option选中

$("#selectId").find("option[value='"+option的值+"']").attr("selected",true);

给div添加属性contenteditable="true"   可编辑

自定义拦截器

1.创建一个MyInterceptor类,并实现HandlerInterceptor接口

public class MyInterceptor implements HandlerInterceptor {

    @Override
    public void afterCompletion(HttpServletRequest arg0,
            HttpServletResponse arg1, Object arg2, Exception arg3)
            throws Exception {
        System.out.println("afterCompletion");
    }

    @Override
    public void postHandle(HttpServletRequest arg0, HttpServletResponse arg1,
            Object arg2, ModelAndView arg3) throws Exception {
        System.out.println("postHandle");
    }

    @Override
    public boolean preHandle(HttpServletRequest arg0, HttpServletResponse arg1,
            Object arg2) throws Exception {
        System.out.println("preHandle");
        return true;
    }

}

2.在SpringMVC的配置文件中配置

<!-- interceptor setting -->
    <mvc:interceptors>
        <mvc:interceptor>
            <mvc:mapping path="/mvc/**"/>
            <bean class="test.SpringMVC.Interceptor.MyInterceptor"></bean>
        </mvc:interceptor>        
    </mvc:interceptors>

3.拦截器执行顺序

mybatis中的refid

首先定义一个sql标签,一定要定义唯一id<sql id="Base" >name,age</sql>

然后通过id引用
<select id="selectAll">
select 
<include refid="Base" />
    from student
</select>

<include refid="Base" />会自动把上面的代码贴过来

 

相关文章

    暂无相关文章
相关栏目:

用户点评