請教open session in view
剛剛接觸Spring,我想做個練習,但總出錯;
struts1.1 + hibernate3+spring1.2.1+Tomcat5
我想使用open session in view模式
hibernate中以設定成lazy="true"。
抱錯:session 以關閉
配置如下
web.xml
?xml version="1.0" encoding="UTF-8"?
!DOCTYPE web-app PUBLIC "-//Sun Microsystems, Inc.//DTD Web Application 2.3//EN" "http://java.sun.com/dtd/web-app_2_3.dtd"
web-app
display-name wish /display-name
context-param
param-name contextConfigLocation /param-name
param-value /WEB-INF/applicationContext.xml /param-value
/context-param
filter
filter-name hibernateFilter /filter-name
filter-class org.springframework.orm.hibernate3.support.OpenSessionInViewFilter /filter-class
init-param
param-name singleSession /param-name
param-value false /param-value
/init-param
/filter
filter-mapping
filter-name hibernateFilter /filter-name
url-pattern *.do /url-pattern
/filter-mapping
listener
listener-class org.springframework.web.context.ContextLoaderListener /listener-class
/listener
servlet
servlet-name action /servlet-name
servlet-class org.apache.struts.action.ActionServlet /servlet-class
init-param
param-name config /param-name
param-value /WEB-INF/struts-config.xml /param-value
/init-param
init-param
param-name debug /param-name
param-value 2 /param-value
/init-param
init-param
param-name application /param-name
param-value ApplicationResources /param-value
/init-param
load-on-startup 2 /load-on-startup
/servlet
servlet-mapping
servlet-name action /servlet-name
url-pattern *.do /url-pattern
/servlet-mapping
.........................
...........................
/web-app
struts-config.xml如下
?xml version="1.0" encoding="UTF-8"?
!DOCTYPE struts-config PUBLIC "-//Apache Software Foundation//DTD Struts Configuration 1.1//EN"
"http://jakarta.apache.org/struts/dtds/struts-config_1_1.dtd"
struts-config
form-beans
form-bean name="lazyForm" type="sixhero.actionForm.LazyForm" /
/form-beans
action-mappings
action name="lazyForm" path="/test/lazyAction" scope="request"
type="org.springframework.web.struts.DelegatingActionProxy"
forward name="ok" path="/test/ok.jsp" /
forward name="no" path="/test/no.jsp" /
/action
/action-mappings
message-resources parameter="ApplicationResources" /
plug-in className="org.springframework.web.struts.ContextLoaderPlugIn"
set-property property="contextConfigLocation" value="/WEB-INF/applicationContext.xml" /
/plug-in
/struts-config
ok.jsp如下
%@ page contentType="text/html; charset=GB2312" %
%@ taglib uri="/WEB-INF/struts-bean.tld" prefix="bean" %
%@ taglib uri="/WEB-INF/struts-html.tld" prefix="html" %
%@ taglib uri="/WEB-INF/struts-logic.tld" prefix="logic" %
%@ taglib uri="/WEB-INF/struts-nested.tld" prefix="nested" %
%@ taglib uri="/WEB-INF/struts-template.tld" prefix="template" %
%@ taglib uri="/WEB-INF/struts-tiles.tld" prefix="tiles" %
html
head
title
ok
/title
/head
body bgcolor="ffffff"
logic:notEmpty name="list"
logic:iterate id="temp" name="list"
bean:write name="temp" property="UserName"/
br
bean:write name="temp" property="forumDescript"/
br
br
bean:write name="temp" property="Order.name" filter="true"/
br
br
/logic:iterate
/logic:notEmpty
/body
/html
Order.name總是抱錯
struts1.1 + hibernate3+spring1.2.1+Tomcat5
我想使用open session in view模式
hibernate中以設定成lazy="true"。
抱錯:session 以關閉
配置如下
web.xml
?xml version="1.0" encoding="UTF-8"?
!DOCTYPE web-app PUBLIC "-//Sun Microsystems, Inc.//DTD Web Application 2.3//EN" "http://java.sun.com/dtd/web-app_2_3.dtd"
web-app
display-name wish /display-name
context-param
param-name contextConfigLocation /param-name
param-value /WEB-INF/applicationContext.xml /param-value
/context-param
filter
filter-name hibernateFilter /filter-name
filter-class org.springframework.orm.hibernate3.support.OpenSessionInViewFilter /filter-class
init-param
param-name singleSession /param-name
param-value false /param-value
/init-param
/filter
filter-mapping
filter-name hibernateFilter /filter-name
url-pattern *.do /url-pattern
/filter-mapping
listener
listener-class org.springframework.web.context.ContextLoaderListener /listener-class
/listener
servlet
servlet-name action /servlet-name
servlet-class org.apache.struts.action.ActionServlet /servlet-class
init-param
param-name config /param-name
param-value /WEB-INF/struts-config.xml /param-value
/init-param
init-param
param-name debug /param-name
param-value 2 /param-value
/init-param
init-param
param-name application /param-name
param-value ApplicationResources /param-value
/init-param
load-on-startup 2 /load-on-startup
/servlet
servlet-mapping
servlet-name action /servlet-name
url-pattern *.do /url-pattern
/servlet-mapping
.........................
...........................
/web-app
struts-config.xml如下
?xml version="1.0" encoding="UTF-8"?
!DOCTYPE struts-config PUBLIC "-//Apache Software Foundation//DTD Struts Configuration 1.1//EN"
"http://jakarta.apache.org/struts/dtds/struts-config_1_1.dtd"
struts-config
form-beans
form-bean name="lazyForm" type="sixhero.actionForm.LazyForm" /
/form-beans
action-mappings
action name="lazyForm" path="/test/lazyAction" scope="request"
type="org.springframework.web.struts.DelegatingActionProxy"
forward name="ok" path="/test/ok.jsp" /
forward name="no" path="/test/no.jsp" /
/action
/action-mappings
message-resources parameter="ApplicationResources" /
plug-in className="org.springframework.web.struts.ContextLoaderPlugIn"
set-property property="contextConfigLocation" value="/WEB-INF/applicationContext.xml" /
/plug-in
/struts-config
ok.jsp如下
%@ page contentType="text/html; charset=GB2312" %
%@ taglib uri="/WEB-INF/struts-bean.tld" prefix="bean" %
%@ taglib uri="/WEB-INF/struts-html.tld" prefix="html" %
%@ taglib uri="/WEB-INF/struts-logic.tld" prefix="logic" %
%@ taglib uri="/WEB-INF/struts-nested.tld" prefix="nested" %
%@ taglib uri="/WEB-INF/struts-template.tld" prefix="template" %
%@ taglib uri="/WEB-INF/struts-tiles.tld" prefix="tiles" %
html
head
title
ok
/title
/head
body bgcolor="ffffff"
logic:notEmpty name="list"
logic:iterate id="temp" name="list"
bean:write name="temp" property="UserName"/
br
bean:write name="temp" property="forumDescript"/
br
br
bean:write name="temp" property="Order.name" filter="true"/
br
br
/logic:iterate
/logic:notEmpty
/body
/html
Order.name總是抱錯
相關文章
- 關於open session in view,想在此請教!SessionView
- open session in viewSessionView
- Open Session In View 探討SessionView
- open session in view引起的事務問題SessionView
- 請教hibernate 中session問題Session
- hibernate open session in view 丟擲異常解決方法SessionView
- 請教tomcat session丟失問題TomcatSession
- 新手請教:action 中 scope="session"之後怎麼用?Session
- su - root could not open sessionSession
- session_max_open_filesSession
- 請教一個在Session Bean中使用JDBC的問題SessionBeanJDBC
- 請教一個有關bibernate的session的問題Session
- BANG老師: 請教一下Hibernate的session問題Session
- 遇到一個關於session id的問題,向大家請教!Session
- SESSION_CURSOR_CACHE open_cursorsSession
- 請教nullpointerexceptionNullException
- 請教高手
- 解決“su: cannot open session: Permission denied”Session
- open_cursors與session_cached_cursorsSession
- su的時候報:could not open sessionSession
- Not Able To Open Forms Session After Cloning.ORMSession
- ejb client 請教client
- 請教ThreadLocalthread
- 各位高手,請教
- 請教prototype模式!模式
- 請教:java安全Java
- 學習請教
- open_cursor session_cached_cursors 優化Session優化
- open_cursor & session_cached_cursor實驗Session
- dbms_session.set_close_cached_open_cursors(true)Session
- 理解V$OPEN_CURSOR,SESSION_CACHED_CURSORSession
- 急:請教在MDB中向另一臺機器發訊息session不能建立Session
- 請教各位大俠,如果查詢一個已建立的有狀態session bean?SessionBean
- 請教phpword問題PHP
- Spring AOP請教Spring
- 請教SAXParseException問題Exception
- jboss安裝請教
- 請教:NullPointerException 問題NullException