请告诉我Web服务器,Web容器和应用程序服务器之间的区别.
我们如何从两个ArrayList中删除常用值.让我们考虑我有两个Arraylist,如下所示
ArrayList1= [1,2,3,4]
ArrayList1= [2,3,4,6,7]
Run Code Online (Sandbox Code Playgroud)
我希望得到结果
ArrayListFinal= [1,6,7]
Run Code Online (Sandbox Code Playgroud)
有人可以帮帮我吗?
这是关于Spring 在服务层OpenSessionInViewFilter使用 @Transactional注释.
我经历了这么多的堆栈溢出帖子,但仍然困惑我是否应该使用OpenSessionInViewFilter或不避免LazyInitializationException
如果有人帮我找到以下查询的答案将是很大的帮助.
OpenSessionInViewFilter在具有复杂模式的应用程序中使用是不好的做法.N+1问题OpenSessionInViewFilter它是否意味着@Transactional不需要?下面是我的Spring配置文件
<context:component-scan base-package="com.test"/>
<context:annotation-config/>
<bean id="messageSource"
class="org.springframework.context.support.ReloadableResourceBundleMessageSource">
<property name="basename" value="resources/messages" />
<property name="defaultEncoding" value="UTF-8" />
</bean>
<bean id="propertyConfigurer"
class="org.springframework.beans.factory.config.PropertyPlaceholderConfigurer"
p:location="/WEB-INF/jdbc.properties" />
<bean id="dataSource"
class="org.apache.commons.dbcp.BasicDataSource" destroy-method="close"
p:driverClassName="${jdbc.driverClassName}"
p:url="${jdbc.databaseurl}" p:username="${jdbc.username}"
p:password="${jdbc.password}" />
<bean id="sessionFactory"
class="org.springframework.orm.hibernate3.LocalSessionFactoryBean">
<property name="dataSource" ref="dataSource" />
<property name="configLocation">
<value>classpath:hibernate.cfg.xml</value>
</property>
<property name="configurationClass">
<value>org.hibernate.cfg.AnnotationConfiguration</value>
</property>
<property name="hibernateProperties">
<props>
<prop key="hibernate.dialect">${jdbc.dialect}</prop>
<prop key="hibernate.show_sql">true</prop>
<!--
<prop key="hibernate.hbm2ddl.auto">create</prop>
-->
</props>
</property>
</bean> …Run Code Online (Sandbox Code Playgroud) 我正在进行下一个测试:
import static org.junit.Assert.assertEquals;
import org.junit.Test;
import org.junit.runner.RunWith;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.test.context.ContextConfiguration;
import org.springframework.test.context.junit4.SpringJUnit4ClassRunner;
@RunWith(SpringJUnit4ClassRunner.class)
@ContextConfiguration(locations = { "/META-INF/spring/applicationContext.xml" })
public class FloorServiceTest {
@Autowired
private FloorService floorService;
@Test
public void testFloorService() {
floorService.findById((long)1);
}
}
Run Code Online (Sandbox Code Playgroud)
用文件applicationContext.xml夹下的文件/APP/src/main/resources/META-INF/spring/
但似乎没有正确地自动装配bean:
org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'com.confloorapp.services.FloorServiceTest': Injection of autowired dependencies failed; nested exception is org.springframework.beans.factory.BeanCreationException: Could not autowire field: private com.confloorapp.services.FloorService com.confloorapp.services.FloorServiceTest.floorService; nested exception is org.springframework.beans.factory.NoSuchBeanDefinitionException: No qualifying bean of type [com.confloorapp.services.FloorService] found for dependency: expected at least …Run Code Online (Sandbox Code Playgroud) 我创建了一个liferay插件portlet项目并在Liferay 6.2中部署.当我尝试部署时,我得到" Portlet Portlet_WAR_portletID有一个null portlet包"错误.我无法找到根,因为我可以看到我指的是正确的插件项目.
SEVERE: Servlet.service() for servlet jsp threw exception
java.lang.NullPointerException
at com.liferay.portlet.PortletContextFactory._create(PortletContextFactory.java:84)
at com.liferay.portlet.PortletContextFactory.create(PortletContextFactory.java:40)
at com.liferay.portlet.PortletConfigFactoryImpl.create(PortletConfigFactoryImpl.java:56)
at com.liferay.portlet.PortletConfigFactoryUtil.create(PortletConfigFactoryUtil.java:32)
at org.apache.jsp.html.portal.render_005fportlet_jsp._jspService(render_005fportlet_jsp.java:606)
at org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:70)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:728)
at com.liferay.portal.servlet.DirectRequestDispatcher.include(DirectRequestDispatcher.java:57)
at com.liferay.portal.servlet.ClassLoaderRequestDispatcherWrapper.doDispatch(ClassLoaderRequestDispatcherWrapper.java:78)
at com.liferay.portal.servlet.ClassLoaderRequestDispatcherWrapper.include(ClassLoaderRequestDispatcherWrapper.java:53)
at com.liferay.portlet.PortletContainerImpl._doRender(PortletContainerImpl.java:655)
at com.liferay.portlet.PortletContainerImpl.render(PortletContainerImpl.java:138)
at com.liferay.portlet.SecurityPortletContainerWrapper.render(SecurityPortletContainerWrapper.java:141)
at com.liferay.portlet.RestrictPortletContainerWrapper.render(RestrictPortletContainerWrapper.java:126)
at com.liferay.portal.kernel.portlet.PortletContainerUtil.render(PortletContainerUtil.java:156)
at com.liferay.portal.layoutconfiguration.util.PortletRenderer._render(PortletRenderer.java:120)
at com.liferay.portal.layoutconfiguration.util.PortletRenderer.access$4(PortletRenderer.java:107)
at com.liferay.portal.layoutconfiguration.util.PortletRenderer$PortletRendererCallable.doCall(PortletRenderer.java:174)
at com.liferay.portal.layoutconfiguration.util.PortletRenderer$PortletRendererCallable.doCall(PortletRenderer.java:1)
at com.liferay.portal.kernel.executor.CopyThreadLocalCallable.call(CopyThreadLocalCallable.java:69)
at java.util.concurrent.FutureTask$Sync.innerRun(Unknown Source)
at java.util.concurrent.FutureTask.run(Unknown Source)
at com.liferay.portal.kernel.concurrent.ThreadPoolExecutor$WorkerTask._runTask(ThreadPoolExecutor.java:682)
at com.liferay.portal.kernel.concurrent.ThreadPoolExecutor$WorkerTask.run(ThreadPoolExecutor.java:593)
at java.lang.Thread.run(Unknown Source)
Run Code Online (Sandbox Code Playgroud) 如何在Jquery fullcalendar中显示重复出现的事件?比如特定日的事件开始并继续运行下一年,那么我将如何在fullcalendar中显示它.
注意:事件信息来自数据库
java ×3
spring ×2
arraylist ×1
collections ×1
fullcalendar ×1
hibernate ×1
java-ee ×1
junit4 ×1
liferay ×1
liferay-6 ×1
list ×1
spring-mvc ×1
unit-testing ×1
webserver ×1