ONGL 在jsp 页面得到后台传过来的对象值, DAO层得到Oracle序列

ONGL 在jsp 页面得到后台传过来的对象值
文章分类:Web前端

1、在jsp页面引入包

Html代码 复制代码

  1. <%@ page import="com.opensymphony.xwork.util.OgnlValueStack"%>
<%@ page import="com.opensymphony.xwork.util.OgnlValueStack"%>

2、得到值

Java代码 复制代码

  1. OgnlValueStack ov = (OgnlValueStack) request.getAttribute("webwork.valueStack");  
  2. String url = (String) ov.findValue("groupId");  
  3. out.println(url); 

 

 

DAO层得到Oracle序列
文章分类:数据库

1、先定义Spring jdbc 变量

Java代码 复制代码

  1. // 序列
  2. private DataFieldMaxValueIncrementer defectInfoCommonSeq; 
// 序列
private DataFieldMaxValueIncrementer defectInfoCommonSeq;

2、DAO初始化时

Java代码 复制代码

  1. @Override
  2. protected void initDao() throws Exception {  
  3.     defectInfoCommonSeq = new OracleSequenceMaxValueIncrementer(super
  4.     .getDataSource(), "PW_DEFECT_INFO_COMMON_SEQ");   
  5. //  super.getDataSource() 因为这里即成了基类,得到数据源
@Override
protected void initDao() throws Exception {
    defectInfoCommonSeq = new OracleSequenceMaxValueIncrementer(super
	.getDataSource(), "PW_DEFECT_INFO_COMMON_SEQ"); 
       //  super.getDataSource() 因为这里即成了基类,得到数据源
}

3、SETTER方法

Java代码 复制代码

  1. @Override
  2. protected String getCommonSequenceName() {  
  3. return "PW_DEFECT_INFO_COMMON_SEQ" ;  
posted @ 2010-06-03 21:42  心梦帆影  阅读(1510)  评论(0编辑  收藏  举报