luan

1.有父子关系的在同一实体里面的配置等操作..
2.关于实体和dto之间的转换..配置
3.
<set name="employees" cascade="save-update" inverse="true" lazy="false">
<key column="d_id"/>
<one-to-many class="Employee"/>
</set>
注意这个inverse的位置..
4. 看task.hbm.xml文件
5.读懂配置文件
6.页面间传递数据方法..
---------------------------------------
<a href="showSingleDataEntryAction.action?dataEntryDTO.entryId=<s:property value="#dataEntry.entryId"/>" >编辑</a>
<input type="hidden" value="${dataEntryDTO.entryId}" name="dataEntryDTO.entryId">
----------------------------------------
7. 学习下service也就是hql方面有什么高级的东西
8.前后台json的交互*******************************为解决
9.jbpm学习
10.freemaker模板
10.<%= %>前台数据接收 var relationBusinessString = <%=((String)request.getAttribute("relationBusinessString"))%>
11.hibernate映射map
12.假期管理..看下具体实现
13.算法学习
14.日期类型属性的处理办法
15.equalsIgnoreCase String类的一个方法..那就是不区分大小写比较两个字符转是否相等返回boolean
16.public enum ReportState {LAUNCH, REPORT, APPROVAL, BACKING}
17.页面超链接的问题 其实就是传递一个id
18.web.xml学习 org.springframework.orm.hibernate3.support.OpenSessionInViewFilter
19.@Scope("prototype")是在action中配置的,意思就是每次调用action是,都新创建一个action。
20.枚举类型在数据库中没有对应..就是一些固定的字符串
public enum UrgentLevel{
SIMPLE,URGENT,EXTRA_URGENT
}
switch (mission.getUrgentLevelEnum()){

case SIMPLE:
mission.setUrgentLevel("普通");
break;
case URGENT:
mission.setUrgentLevel("紧急");
break;
case EXTRA_URGENT:
mission.setUrgentLevel("特急");
break;
default:
break;
}
21.ognl学习
22.inner join等sql学习
select org.orgId from Organization org inner join org.positionList p where p.positionId=?
此地positionList是集合 设计到关系属性放到集合里的情况 我们这么做
22.hibernate拦截器是什么
23.发现一个问题:问什么 p.positionId不能用呢
24.今天的问题是 缓存 更新的时候产生的 看测试

25.delete all
26.排序迭代
27.问田哥关于排序的问题 在hibernate 的配置文件中配置一个 怎么配呢 那就要问了 看到了 是这样的 ordey_by="positionName asc"
28.判断集合里是否有某个对象,那就用contains方法,公司封装了
29.oracle数据库_是匹配一个字符的意思
30.service里面 save()后可以直接返回被添加的Id
31.<bag name="positionList" table="T_ORGMANAGE_POSITION" cascade="delete" lazy="false" inverse="true">
<key>
<column name="ORGID" precision="22" scale="0" not-null="true" />
</key>
<one-to-many class="com.gosophia.organizationManagement.entity.Position" />
</bag>
list<Position> 里面是position所以one-to-many里写Position
<column name="ORGID" precision="22" scale="0" not-null="true" />
这里的ORGID指的是position里的外键 指向Organization
<bag name="subBranches" lazy="true" table="T_TASKMANAGEMENT_JOB"
inverse="true">
<key>
<column name="JOBPARENTID" precision="22" scale="0" />
</key>
<one-to-many class="com.gosophia.taskManagement.entity.Job"/>
</bag>
这里的<one-to-many class="com.gosophia.taskManagement.entity.Job"/>指的是list<Job>里面的东西

这个好好看看!!
32.如何创建sql文
33.switch (String.valueOf(width).length()) {
case 1:
nextMissionCode = missionType + today + "00"+width;
break;
case 2:
nextMissionCode = missionType + today + "0"+width;
break;
case 3:
nextMissionCode = missionType + today + width;
break;
default:
break;
}
34.<s:iterator id="importance" value="importanceList">
<option value="${importance.dataValueId }">${importance.value}</option>
</s:iterator>
35 lazy="proxy" 把取出来的数据放在了缓存中
36:在映射文件中排序
<set name="address" table="t_address" cascade="all" order_by="code asc">
<key column="user_id">
<one-to-many class="com.model.Address"/>
<set>
37:&是“&” 在struts配置文件不识别&可以用&来代替。
38,后台传前台数据出错,解决:
private String name;
private String password;
程序里这样:String newName = new String(name.getBytes("ISO-8859-1"),"UTF-8");
String newPassword = new String(password.getBytes("ISO-8859-1"),"UTF-8");
39:在下拉下单中添加version
<select name="missionDTO.importanceDTO.dataValueId" id="importanceLevelSelector" hiddenVersionName="missionDTO.importanceDTO.version" class="_hide need-version require{required: true, messages: {required: '必须选择'}}">
<s:if test="importanceList">
<s:iterator id="importance" value="importanceList">
<option value="${importance.dataValueId}" version="${importance.version }">${importance.value}</option>
</s:iterator>
</s:if>
</select>
40:问下田哥这是干什么的 com.gosophia.util.OAContextLoaderListener 在web.xml配置文件里的
41:public Page<Job> findMyTodoJobByJobTypeAndByPage(Long myUserInfoId,
Long missionTypeId, Page<Job> page,
List<PropertyFilter> propertyFilters,
List<OrderCondition> orderConditions, String... jobType) {}
这里的String... jobType是数量不确定,放在了数组里面的参数
Arrays.asList(jobType);返回的是集合,就是把数组变成集合的方法
42:<%@include file="../report/attachReportContent.jsp" %>把源代码包含到此页面中
<jsp:include page="../frame/middle_left.jsp" flush="true"> 将最终的结果合并输出,你运行
你的 我运行我的。
43. <s:iterator value="jobList" id="job">
<s:property value="#job.jobName"/>或者
${job.jobName}
</s:iterator>
44. <action name="attachmentReport" class="attachmentReportAction">
<result type="redirect">/web/initReportDataListAction.action?parame=bssj</result>
</action>
parame这个参数在action用 String parame来接收
45.先看struts2验证 在看soa理念
46.Pattern.matchers("\\w{4,25}",name.trim()){
errstr += 输入的必须是数字字母 长度在4-25之间
}
47.学习log
48. Class c=Class.forName("news.Teacher");
Object o = c.newInstance();
Method m2=c.getDeclaredMethod("getName", String.class);
String a = (String) m2.invoke(o,"a");
Method m = c.getDeclaredMethod("getName");
m.invoke(o);
此类的包名是news所以我们在创建类对象的时候要注意包结构也就是用点"."来区分
49.文件上传就是io流的操作创建新的被上传的文件就在io流里创建
File file = new File("E://a.txt");
String str = "/";
File f = new File(str);
if(!f.exists()){
f.mkdir();
}

String name = "file.txt";
InputStream ips = new FileInputStream(file);
OutputStream ops = new FileOutputStream(new File(f,name));
int len = 0;
byte[] b = new byte[256];
if((len = ips.read(b))>0){
ops.write(b,0,len);
}
ops.close();
ips.close();
文件上传会遇到中文乱码的问题,那么我们在struts2配置文件这样配置
<constant name="struts.il8n.encoding" value="GBK"></constant>
假如遇到临时文件出错的问题那么我们这么配置还是在struts2配置文件
<constant name="struts.multipart.saveDir" value="c:\"></constant>
文件上传得到上传的文件时这么写的
String root = servletActionContext.getRequest().realPath("/XXX");
文件下载时我们得到要得到inputStream流 方法名称必须要用getXXXX
InputStream ips = ServletActionContext.getServletContext().getResurceAsStream("/文件 路径");
Map<String,object> session = ActionContext.getContext().getSession();得到的是session
你要是用自己的拦截器那么加的时候也要加上struts自己的默认拦截器否则程序无法运行
50. 时间格式定义:
<s:date name="reportingDto.endDate" format="yyyy-MM-dd"/>
51. 如果在action里写this.addFieldError("userName","不正确");
那么就写个input
52.拦截器
用interceptors定义拦截器
<interceptors>
<intercepror name="myInterceptor" class="com.gosophia.MyInterceptor">

</intercepror>
<intercepror-stack name="allStack"> 这是定义拦截器栈
<intercepror-ref="myInterceptor"/>
<interceptor-ref="defaultStack"/>
</interceprors>
定义全局拦截器
<interceptor-interceptor-ref name="allStack"/>
53. <interceptors>
<interceptor name="myInterceptor" class="com.test.struts2.MyInterceptor">
<param name="helli">word</param>
</interceptor>
<interceptor-stack name="allStack">
<interceptor-ref name="myInterceptor"></interceptor-ref>
<!-- 防止表单重复提交 -->
<interceptor-ref name="token"></interceptor-ref>
<interceptor-ref name="defaultStack"></interceptor-ref>
</interceptor-stack>
</interceptors>
<default-interceptor-ref name="allStack"></default-interceptor-ref>
但是还要给action配置这个 <result name="invalid.token">/jsp/message_error.jsp</result>
当有重复的时候怎么办,即跳转到那个页面。
54. struts2得到servlet的request 或者 response 等,都是通过ioc的思想注入进去的,也就是action 实现 ServletRequestAware 然后定义private HttpServletRequest request 就可以的到request了
55.用户名也可以放到Cookie里面,Cookie是有有效期的,cookie.setMaxAge(1000miao); 0的话回话结束
cookie就结束,是负数的话,只有当浏览器关掉才行 Cookie co = new Cookie (username","systemUserName");
56.对于一对多双向的 用bag还是比较高效的。无需初始化fetch
57.学习下tomcat的知识
58.FreeMaker的模板是一个.ftl的文本文件,在该文件中使用了一些FreeMaker的特别标记,这些标记会动态的显示或者控制程序输出
步骤:1 创建Configuration
59 slf4j日志管理是hibernate的 JPA是个标准hibernate实现了它
60. etag方式就是很好的利用缓存浏览器的
HttpServletResponse response = ServletActionContext.getResponse();
response.setHeader("Cache-Control","no-store, no-cache, must-revalidate"); //HTTP 1.1
response.setHeader("Pragma","no-cache"); //HTTP 1.0
response.setDateHeader ("Expires", 0); //prevents caching at the proxy server
etag缓存...get方式使用浏览器缓存..上面的用法就是使这次请求不缓存并且在<param name="no-cache">true</param>
61.<Connector port="8080" protocol="HTTP/1.1"
connectionTimeout="20000"
redirectPort="8443" useBodyEncodingForURI="true" URIEncoding="GBK"/>
tomcat拦截使编码正确
62. powerdesigner
63. @Temporal对日期的注解,对于枚举类型的话 这样注解 @Enumerated(EnumType.STRING)
64.openSession 每次都是新的需要手动关闭session 而getCurrentSession是从上下文找如果有用旧的没有就用新的,当提交后事物自动关闭 这个有两种方式得到,一个是jta java Transaction api 另一个是thread 可以在配置文件配置 但是这两个不能混用!貌似实现类不一样 hibernate 的update操作必须有id 因为他是根据id做更新操作的
65. 在xml写 class里面 写一个
dynamic-update="true" 这种方式是一个session
66. oralce 用in可以实现exists的功能,但是exists的执行效率比in高
  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值