由于两个表的管理关系,我的bean里面有个临时字段是数据库表一中没有的,如果在页面上输入信息没有涉及该临时字段,能够成功插入;如果在页面上输入的信息包括了那个临时字段(如果页面上涉及了临时字段,就要在数据库表一和表二中都插入相关数据,临时字段是表二中的),就插入的时候报错“ORA-01401: 插入的值对于列过大”;我试过获取页面输入值后并且表二插入成功后把那个临时字段设为null,可是还是会报错“ORA-01401: 插入的值对于列过大”,大家指点指点bean的代码:
public class A extends ActionForm{
   private String a;
   private List<B> b=new AutoArrayList(B.class);
   public String getA() {
return a;
}
   public void setA(String a) {
this.a= a;
}
   @Transient
   public List<B> getB() {
return b;
}
   public void setB(List<B> b) {
this.b= b;
}
}
action代码:
public ActionForward insert(ActionMapping mapping, ActionForm actionForm,
HttpServletRequest request, HttpServletResponse response)
throws Exception{

try{
A aa = (A) actionForm;
List bb= A.getB();
if(bb!=null){
B b = new B();
for(int i = 0;i<bb.size();i++){
b= (B)bb.get(i);          Manager.insertB(b);
}
}
Manager.setB(null);
Manager.insert(aa);

request.setAttribute("PopInfoBean", PopInfoBean.setinfo("添加成功","sunacl/forminfoaction.do?method=detail"));
return mapping.findForward("redirect");
}catch(Exception e){
return mapping.findForward("error");
}
}