Win a copy of Securing DevOps this week in the Security forum!

avseq anthoy

Ranch Hand
+ Follow
since Apr 27, 2004
Cows and Likes
Cows
Total received
0
In last 30 days
0
Total given
0
Likes
Total received
1
Received in last 30 days
0
Total given
0
Given in last 30 days
0
Forums and Threads
Scavenger Hunt
expand Ranch Hand Scavenger Hunt
expand Greenhorn Scavenger Hunt

Recent posts by avseq anthoy

Hi , I add hashcode function ,but the result is same as without hashcode function.


1 year ago
Dear all

Because I have to sort my data , so I use TreeSet instead of HashSet.
I decide load data from a text file(input.txt) , the file content is as below


If I use the HashSet, the result is as below


But if I use TreeSet , the result only contains three object


I expect that there are always 4 object wherever I use TreeSet or HashSet , so I don't know what happen!
May someone help me to solve the question? My Sample code as below.

1 year ago
I had thought about aggregate function.
If the data as below


If the statement as :


The result will be , the is the wrong result


I want the answer is




Roel De Nijs wrote:Have a look at the aggregate functions.

Dear all

I have the data as below




If the person has multiple records, I want get the min priority record.
If there are still multiple records after i get the max priority for the persion, I want to get the min Step record.

So in the above example. I want get the data as below.



How can I use one sql statement to achieve it? I use Oracle

Jeanne Boyarsky wrote:Yes. The SCJP is a valid pre-requisite exam.


Thanks for your reply.
But I register my account on the prometric and prometric has my record.
Now I should schedule the exam on the VUE , but I didn't have VUE account.
If I register a new account , how VUE know my Java certification history ?
Dear all

Can i go to get OCEJWSD if I only have scjp 1.4 and scwcd 1.4?
Dear all

I use Spring 2.5.6 + Hibernate 3.2.GA to implement the application.
And I use the declared transaction in spring , configuration as below


Because I must control the information should be saved when System occurs exception, so I should declare some action to PROPAGATION_REQUIRES_NEW. When I execute the performance , it always show the exception as below


Because the transaction is controlled by Spring, I didn't how to check whether it will release the connection after the transaction complete.

Can someone tell me how to resolve the connection leak problem/

thanks~

Best Regards
Dear all


Can I set the JBoss Locale default from Locale.CHINESE to Locale.US ?
thanks~


Best Regards
6 years ago
Dear all

I have a table as below


For the Bill_TYPE column , the value 0、1 and 2 represent different bill type.
Should I use an enum for the column mapping or only use the normal java String for the column mapping?

I think the java string for the column mapping is simpler than enum mapping in the application.
But use enum can avoid assign wrong type value in the code.

Can someone give me other suggestions?
thanks~
Dear all
I have a class as below.


The error message of the class is


But I don't know the meaning.
Can somebody tell me how to solve the problem?

Thanks
7 years ago
I have a jsp page.
Is it reasonable that the page have the code "session.setAttribute("abc")" if I use a mvc framework ?

I think the view layer should only the logic for presentation.
I think the "session.setAttribute("abc")" has some smell for bussiness logic.
Can somebody give me other suggestion?

Thanks~
Hibernate Transaction filter as below


I refine the log as below, the red text is the log entries about transaction begin and commit in the HibernateTransactionFilter

[11/01/17 14:46:56][org.apache.jasper.servlet.JspServlet#service] JspEngine --> /popupPage/CopyGrpTree.jsp

[11/01/17 14:46:56][org.apache.jasper.servlet.JspServlet#service] ServletPath: /popupPage/CopyGrpTree.jsp

[11/01/17 14:46:56][org.apache.jasper.servlet.JspServlet#service] PathInfo: null

[11/01/17 14:46:56][org.apache.jasper.servlet.JspServlet#service] RealPath: D:\workspace\.metadata\.plugins\org.eclipse.wst.server.core\tmp0\wtpwebapps\iportal\popupPage\CopyGrpTree.jsp

[11/01/17 14:46:56][org.apache.jasper.servlet.JspServlet#service] RequestURI: /iportal/popupPage/CopyGrpTree.jsp

[11/01/17 14:46:56][org.apache.jasper.servlet.JspServlet#service] QueryString: null

[11/01/17 14:46:56][org.apache.jasper.servlet.JspServlet#service] Request Params:


[11/01/17 14:46:56][com.taiwanmobile.iportal.filter.HibernateSessionRequestFilter#doFilter] Filter Transaction begin...

[11/01/17 14:46:56][com.taiwanmobile.iportal.filter.HibernateSessionRequestFilter#doFilter] Transaction Begin

[11/01/17 14:46:56][com.taiwanmobile.iportal.filter.HibernateSessionRequestFilter#doFilter] Filter Transaction begin...

[11/01/17 14:46:56][com.taiwanmobile.iportal.filter.HibernateSessionRequestFilter#doFilter] Transaction Begin

[11/01/17 14:46:56][com.taiwanmobile.iportal.filter.HibernateSessionRequestFilter#doFilter] Transaction Begin ok

[11/01/17 14:46:56][org.springframework.web.servlet.DispatcherServlet#getHandler] Testing handler map [org.springframework.web.servlet.handler.BeanNameUrlHandlerMapping@30f369] in DispatcherServlet with name 'dispatcherServlet'

[11/01/17 14:46:56][org.springframework.web.servlet.handler.AbstractUrlHandlerMapping#getHandlerInternal] Looking up handler for [/mngGrp.do]

[11/01/17 14:46:56][org.springframework.web.servlet.DispatcherServlet#getHandlerAdapter] Testing handler adapter [org.springframework.web.servlet.mvc.HttpRequestHandlerAdapter@13cba41]

[11/01/17 14:46:56][org.springframework.web.servlet.DispatcherServlet#getHandlerAdapter] Testing handler adapter [org.springframework.web.servlet.mvc.SimpleControllerHandlerAdapter@1127c4d]

[11/01/17 14:46:56][org.springframework.web.servlet.DispatcherServlet#getLastModified] Last-Modified value for [/iportal/mngGrp.do] is: -1

[11/01/17 14:46:56][org.springframework.web.servlet.DispatcherServlet#doService] DispatcherServlet with name 'dispatcherServlet' received request for [/iportal/mngGrp.do]

[11/01/17 14:46:56][org.springframework.web.servlet.DispatcherServlet#doDispatch] Bound request context to thread: org.apache.catalina.connector.RequestFacade@10a69f0

[11/01/17 14:46:56][org.springframework.web.servlet.DispatcherServlet#getHandlerAdapter] Testing handler adapter [org.springframework.web.servlet.mvc.HttpRequestHandlerAdapter@13cba41]

[11/01/17 14:46:56][org.springframework.web.servlet.DispatcherServlet#getHandlerAdapter] Testing handler adapter [org.springframework.web.servlet.mvc.SimpleControllerHandlerAdapter@1127c4d]

[11/01/17 14:46:56][org.springframework.beans.factory.support.AbstractBeanFactory#doGetBean] Returning cached instance of singleton bean 'CompanyInfoMap'

[11/01/17 14:46:56][org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory#invokeInitMethods] Invoking afterPropertiesSet() on bean with name 'popupPage/CopyGrpTreeLeft'

[11/01/17 14:46:56][org.springframework.web.servlet.view.AbstractCachingViewResolver#resolveViewName] Cached view [popupPage/CopyGrpTreeLeft]

[11/01/17 14:46:56][org.springframework.web.servlet.DispatcherServlet#render] Rendering view [org.springframework.web.servlet.view.JstlView: name 'popupPage/CopyGrpTreeLeft'; URL [popupPage/CopyGrpTreeLeft.jsp]] in DispatcherServlet with name 'dispatcherServlet'

[11/01/17 14:46:56][org.springframework.web.servlet.view.AbstractView#render] Rendering view with name 'popupPage/CopyGrpTreeLeft' with model {list=[com.taiwanmobile.iportal.dao.iportaldb.GrpInfo@f4ec4093, com.taiwanmobile.iportal.dao.iportaldb.GrpInfo@fe38dfc1, com.taiwanmobile.iportal.dao.iportaldb.GrpInfo@bc3e4a3, com.taiwanmobile.iportal.dao.iportaldb.GrpInfo@ef47aef9, com.taiwanmobile.iportal.dao.iportaldb.GrpInfo@a93f89c3, com.taiwanmobile.iportal.dao.iportaldb.GrpInfo@5e374a5f, com.taiwanmobile.iportal.dao.iportaldb.GrpInfo@ee90b31c, com.taiwanmobile.iportal.dao.iportaldb.GrpInfo@6c6d05a1, com.taiwanmobile.iportal.dao.iportaldb.GrpInfo@c8b41dc, com.taiwanmobile.iportal.dao.iportaldb.GrpInfo@b2cf2f6c, com.taiwanmobile.iportal.dao.iportaldb.GrpInfo@61e4e04c, com.taiwanmobile.iportal.dao.iportaldb.GrpInfo@d65f85ac, com.taiwanmobile.iportal.dao.iportaldb.GrpInfo@cea2db43, com.taiwanmobile.iportal.dao.iportaldb.GrpInfo@4e271d6e, com.taiwanmobile.iportal.dao.iportaldb.GrpInfo@c83e883, com.taiwanmobile.iportal.dao.iportaldb.GrpInfo@d914c24f, com.taiwanmobile.iportal.dao.iportaldb.GrpInfo@c3a1be35, com.taiwanmobile.iportal.dao.iportaldb.GrpInfo@99ed6515, com.taiwanmobile.iportal.dao.iportaldb.GrpInfo@f025c10b, com.taiwanmobile.iportal.dao.iportaldb.GrpInfo@98f9cf09], act=redirect_grp_query, pagingInfo=com.taiwanmobile.iportal.util.Paging@1d1358f, companyMap={1=abc, 2=def, 3=ijk , 4=mno}, queryName=} and static attributes {}

[11/01/17 14:46:56][org.springframework.web.servlet.view.AbstractView#exposeModelAsRequestAttributes] Added model object 'list' of type [java.util.ArrayList] to request in view with name 'popupPage/CopyGrpTreeLeft'

[11/01/17 14:46:56][org.springframework.web.servlet.view.AbstractView#exposeModelAsRequestAttributes] Added model object 'act' of type [java.lang.String] to request in view with name 'popupPage/CopyGrpTreeLeft'

[11/01/17 14:46:56][org.springframework.web.servlet.view.AbstractView#exposeModelAsRequestAttributes] Added model object 'companyMap' of type [java.util.HashMap] to request in view with name 'popupPage/CopyGrpTreeLeft'

[11/01/17 14:46:56][org.springframework.web.servlet.view.AbstractView#exposeModelAsRequestAttributes] Added model object 'pagingInfo' of type [com.taiwanmobile.iportal.util.Paging] to request in view with name 'popupPage/CopyGrpTreeLeft'

[11/01/17 14:46:56][org.springframework.web.servlet.view.AbstractView#exposeModelAsRequestAttributes] Added model object 'queryName' of type [java.lang.String] to request in view with name 'popupPage/CopyGrpTreeLeft'

[11/01/17 14:46:56][org.apache.catalina.core.ApplicationDispatcher#<init>] servletPath=/popupPage/CopyGrpTreeLeft.jsp, pathInfo=null, queryString=null, name=null

[11/01/17 14:46:56][org.springframework.web.servlet.view.InternalResourceView#renderMergedOutputModel] Forwarding to resource [popupPage/CopyGrpTreeLeft.jsp] in InternalResourceView 'popupPage/CopyGrpTreeLeft'

[11/01/17 14:46:56][org.apache.catalina.core.ApplicationDispatcher#doForward] Path Based Forward

[11/01/17 14:46:56][org.apache.jasper.servlet.JspServlet#service] JspEngine --> /popupPage/CopyGrpTreeLeft.jsp

[11/01/17 14:46:56][org.apache.jasper.servlet.JspServlet#service] ServletPath: /popupPage/CopyGrpTreeLeft.jsp

[11/01/17 14:46:56][org.apache.jasper.servlet.JspServlet#service] PathInfo: null

[11/01/17 14:46:56][org.apache.jasper.servlet.JspServlet#service] RealPath: D:\workspace\.metadata\.plugins\org.eclipse.wst.server.core\tmp0\wtpwebapps\iportal\popupPage\CopyGrpTreeLeft.jsp

[11/01/17 14:46:56][org.apache.jasper.servlet.JspServlet#service] RequestURI: /iportal/popupPage/CopyGrpTreeLeft.jsp

[11/01/17 14:46:56][org.apache.jasper.servlet.JspServlet#service] QueryString: act=popup_grp_query

[11/01/17 14:46:56][org.apache.jasper.servlet.JspServlet#service] Request Params:

[11/01/17 14:46:56][org.apache.jasper.servlet.JspServlet#service] act = popup_grp_query

[11/01/17 14:46:56][org.apache.catalina.core.ApplicationDispatcher#<init>] servletPath=/template/CopyGrpTreePaging.jsp, pathInfo=null, queryString=null, name=null

[11/01/17 14:46:56][org.apache.catalina.core.ApplicationDispatcher#doInclude] Path Based Include

[11/01/17 14:46:56][org.apache.jasper.servlet.JspServlet#service] JspEngine --> /template/CopyGrpTreePaging.jsp

[11/01/17 14:46:56][org.apache.jasper.servlet.JspServlet#service] ServletPath: /popupPage/CopyGrpTreeLeft.jsp

[11/01/17 14:46:56][org.apache.jasper.servlet.JspServlet#service] PathInfo: null

[11/01/17 14:46:56][org.apache.jasper.servlet.JspServlet#service] RealPath: D:\workspace\.metadata\.plugins\org.eclipse.wst.server.core\tmp0\wtpwebapps\iportal\template\CopyGrpTreePaging.jsp

[11/01/17 14:46:56][org.apache.jasper.servlet.JspServlet#service] RequestURI: /iportal/popupPage/CopyGrpTreeLeft.jsp

[11/01/17 14:46:56][org.apache.jasper.servlet.JspServlet#service] QueryString: act=popup_grp_query

[11/01/17 14:46:56][org.apache.jasper.servlet.JspServlet#service] Request Params:

[11/01/17 14:46:56][org.apache.jasper.servlet.JspServlet#service] act = popup_grp_query

[11/01/17 14:46:56][org.apache.catalina.core.ApplicationDispatcher#doForward] Disabling the response for futher output

[11/01/17 14:46:56][org.springframework.web.servlet.DispatcherServlet#doDispatch] Cleared thread-bound request context: org.apache.catalina.connector.RequestFacade@10a69f0

[11/01/17 14:46:56][org.springframework.web.servlet.FrameworkServlet#processRequest] Successfully completed request

[11/01/17 14:46:56][org.springframework.context.support.AbstractApplicationContext#publishEvent] Publishing event in context [org.springframework.web.context.support.XmlWebApplicationContext@1bb205a]: ServletRequestHandledEvent: url=[/iportal/mngGrp.do]; client=[127.0.0.1]; method=[GET]; servlet=[dispatcherServlet]; session=[D9440CE41C66AFA2B84DA89D928A9937]; user=[null]; time=[63ms]; status=[OK]

[11/01/17 14:46:56][com.taiwanmobile.iportal.filter.HibernateSessionRequestFilter#doFilter] Transaction commit

[11/01/17 14:47:03][com.taiwanmobile.iportal.filter.HibernateSessionRequestFilter#doFilter] Transaction Begin ok


[11/01/17 14:47:03][org.springframework.web.servlet.DispatcherServlet#getHandler] Testing handler map [org.springframework.web.servlet.handler.BeanNameUrlHandlerMapping@30f369] in DispatcherServlet with name 'dispatcherServlet'

[11/01/17 14:47:03][org.springframework.web.servlet.handler.AbstractUrlHandlerMapping#getHandlerInternal] Looking up handler for [/mngNode.do]

[11/01/17 14:47:03][org.springframework.web.servlet.DispatcherServlet#getHandlerAdapter] Testing handler adapter [org.springframework.web.servlet.mvc.HttpRequestHandlerAdapter@13cba41]

[11/01/17 14:47:03][org.springframework.web.servlet.DispatcherServlet#getHandlerAdapter] Testing handler adapter [org.springframework.web.servlet.mvc.SimpleControllerHandlerAdapter@1127c4d]

[11/01/17 14:47:03][org.springframework.web.servlet.DispatcherServlet#getLastModified] Last-Modified value for [/iportal/mngNode.do] is: -1

[11/01/17 14:47:03][org.springframework.web.servlet.DispatcherServlet#doService] DispatcherServlet with name 'dispatcherServlet' received request for [/iportal/mngNode.do]

[11/01/17 14:47:03][org.springframework.web.servlet.DispatcherServlet#doDispatch] Bound request context to thread: org.apache.catalina.connector.RequestFacade@d8431c

[11/01/17 14:47:03][org.springframework.web.servlet.DispatcherServlet#getHandlerAdapter] Testing handler adapter [org.springframework.web.servlet.mvc.HttpRequestHandlerAdapter@13cba41]

[11/01/17 14:47:03][org.springframework.web.servlet.DispatcherServlet#getHandlerAdapter] Testing handler adapter [org.springframework.web.servlet.mvc.SimpleControllerHandlerAdapter@1127c4d]

[11/01/17 14:47:03][com.taiwanmobile.iportal.facade.NodeFacade#showGrpTree] act=redirect_node_queryGrpTree01

[11/01/17 14:47:03][org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory#invokeInitMethods] Invoking afterPropertiesSet() on bean with name 'popupPage/CopyGrpTreeRight'

[11/01/17 14:47:03][org.springframework.web.servlet.view.AbstractCachingViewResolver#resolveViewName] Cached view [popupPage/CopyGrpTreeRight]

[11/01/17 14:47:03][org.springframework.web.servlet.DispatcherServlet#render] Rendering view [org.springframework.web.servlet.view.JstlView: name 'popupPage/CopyGrpTreeRight'; URL [popupPage/CopyGrpTreeRight.jsp]] in DispatcherServlet with name 'dispatcherServlet'

[11/01/17 14:47:03][org.springframework.web.servlet.view.AbstractView#render] Rendering view with name 'popupPage/CopyGrpTreeRight' with model {isNodeSaved=false, IportalTreeNodes=[]} and static attributes {}

[11/01/17 14:47:03][org.springframework.web.servlet.view.AbstractView#exposeModelAsRequestAttributes] Added model object 'isNodeSaved' of type [java.lang.Boolean] to request in view with name 'popupPage/CopyGrpTreeRight'

[11/01/17 14:47:03][org.springframework.web.servlet.view.AbstractView#exposeModelAsRequestAttributes] Added model object 'IportalTreeNodes' of type [java.util.ArrayList] to request in view with name 'popupPage/CopyGrpTreeRight'

[11/01/17 14:47:03][org.apache.catalina.core.ApplicationDispatcher#<init>] servletPath=/popupPage/CopyGrpTreeRight.jsp, pathInfo=null, queryString=null, name=null

[11/01/17 14:47:03][org.springframework.web.servlet.view.InternalResourceView#renderMergedOutputModel] Forwarding to resource [popupPage/CopyGrpTreeRight.jsp] in InternalResourceView 'popupPage/CopyGrpTreeRight'

[11/01/17 14:47:03][org.apache.catalina.core.ApplicationDispatcher#doForward] Path Based Forward

[11/01/17 14:47:03][org.apache.jasper.servlet.JspServlet#service] JspEngine --> /popupPage/CopyGrpTreeRight.jsp

[11/01/17 14:47:03][org.apache.jasper.servlet.JspServlet#service] ServletPath: /popupPage/CopyGrpTreeRight.jsp

[11/01/17 14:47:03][org.apache.jasper.servlet.JspServlet#service] PathInfo: null

[11/01/17 14:47:03][org.apache.jasper.servlet.JspServlet#service] RealPath: D:\workspace\.metadata\.plugins\org.eclipse.wst.server.core\tmp0\wtpwebapps\iportal\popupPage\CopyGrpTreeRight.jsp

[11/01/17 14:47:03][org.apache.jasper.servlet.JspServlet#service] RequestURI: /iportal/popupPage/CopyGrpTreeRight.jsp

[11/01/17 14:47:03][org.apache.jasper.servlet.JspServlet#service] QueryString: act=redirect_node_queryGrpTree01&default=yes

[11/01/17 14:47:03][org.apache.jasper.servlet.JspServlet#service] Request Params:

[11/01/17 14:47:03][org.apache.jasper.servlet.JspServlet#service] act = redirect_node_queryGrpTree01

[11/01/17 14:47:03][org.apache.jasper.servlet.JspServlet#service] default = yes

[11/01/17 14:47:03][org.apache.catalina.core.ApplicationDispatcher#doForward] Disabling the response for futher output

[11/01/17 14:47:03][org.springframework.web.servlet.DispatcherServlet#doDispatch] Cleared thread-bound request context: org.apache.catalina.connector.RequestFacade@d8431c

[11/01/17 14:47:03][org.springframework.web.servlet.FrameworkServlet#processRequest] Successfully completed request

[11/01/17 14:47:03][org.springframework.context.support.AbstractApplicationContext#publishEvent] Publishing event in context [org.springframework.web.context.support.XmlWebApplicationContext@1bb205a]: ServletRequestHandledEvent: url=[/iportal/mngNode.do]; client=[127.0.0.1]; method=[GET]; servlet=[dispatcherServlet]; session=[D9440CE41C66AFA2B84DA89D928A9937]; user=[null]; time=[16ms]; status=[OK]

[11/01/17 14:47:03][com.taiwanmobile.iportal.filter.HibernateSessionRequestFilter#doFilter] Transaction commit

Arun Kumarr wrote:I'll rephrase. Can you post your application log file entries.


Thanks for your prompt reply.But I can't get your point.
Does the application log file entries meaning the log that I tested only Spring framework's log?
Here is the log as below(I eliminate the logs that produced by my applcation because it is not English):
Thanks for your reply
I use Oracle 10G, and I didn't specify any isolation level in my application.
So I think the isolation level is default in the Hibernate.

I try to print the Hibernate log using the following log4j.properties


But it only shows Spring framework's log. I can't see any logs about Hibernate.
Are there any wrong with my configuration?