Re: [jboss-user] [JNDI and Naming] - Binding a SessionFactory
by Lulseged Zerfu
Lulseged Zerfu [http://community.jboss.org/people/lulseged] replied to the discussion
"Binding a SessionFactory"
To view the discussion, visit: http://community.jboss.org/message/537067#537067
--------------------------------------------------------------
Hi
I have added session factory name. It needs hibernate.jndi.class in hibernate.properties.
<?xml version="1.0" encoding="utf-8"?>
<!DOCTYPE hibernate-configuration PUBLIC
"-//Hibernate/Hibernate Configuration DTD 3.0//EN" " http://hibernate.sourceforge.net/hibernate-configuration-3.0.dtd http://hibernate.sourceforge.net/hibernate-configuration-3.0.dtd">
<hibernate-configuration>
<session-factory *name="java:comp/env/jdbc/resource-list"*>
<property name="hibernate.connection.driver_class">com.mysql.jdbc.Driver</property>
<property name="hibernate.connection.password">ddbuser</property>
<property name="hibernate.connection.url">jdbc:mysql://127.0.0.1:3306/ddb</property>
<property name="hibernate.connection.username">ddbuser</property>
<property name="hibernate.default_schema">ddb</property>
<property name="hibernate.dialect">org.hibernate.dialect.MySQLInnoDBDialect</property>
<property name="hibernate.format_sql">true</property>
<property name="hibernate.show_sql">true</property>
<property name="current_session_context_class">thread</property>
<property name="hibernate.max_fetch_depth">3</property>
<property name="hibernate.generate_statistics">true</property>
<property name="hibernate.connection.pool_size">10</property>
<mapping resource="hbm/ResourceListUser.hbm.xml" />
<mapping resource="hbm/ResourceList.hbm.xml" />
<mapping resource="hbm/ResourceListType.hbm.xml" />
<mapping resource="hbm/ResourceListEntry.hbm.xml" />
<mapping resource="hbm/ResourceListEntryReference.hbm.xml" />
<mapping resource="hbm/ResourceListExternal.hbm.xml" />
<mapping resource="hbm/Subscription.hbm.xml" />
</session-factory>
</hibernate-configuration>
#hibernate.properties
hibernate.generate_statistics=true
hibernate.cache.use_query_cache=true
hibernate.cache.use_structured_entries=true
hibernate.cache.provider_class=net.sf.ehcache.hibernate.SingletonEhCacheProvider
hibernate.use_sql_comments=true
hibernate.cache.use_second_level_cache=true
hibernate.c3p0.min_size=5
hibernate.c3p0.max_size=20
hibernate.c3p0.timeout=1800
hibernate.c3p0.max_statements=50
hibernate.jndi.class=com.ericsson.ims.pag.xdms.resource.list.session.SessionFactoryContext
package com.ericsson.ims.pag.xdms.resource.list.session;
import java.util.Hashtable;
import javax.naming.Context;
import javax.naming.NamingException;
import javax.naming.spi.InitialContextFactory;
public class SessionFactoryContext implements InitialContextFactory
{
public Context getInitialContext(Hashtable<?, ?> environment) throws NamingException
{
return new InitialContext(environment);
}
}
Lulseged
--------------------------------------------------------------
Reply to this message by going to Community
[http://community.jboss.org/message/537067#537067]
Start a new discussion in JNDI and Naming at Community
[http://community.jboss.org/choose-container!input.jspa?contentType=1&cont...]
16 years
[JBoss Portal] - actionRequest.getContentType() returning text/xml; charset=UTF-8
by raju k
raju k [http://community.jboss.org/people/komariraj] created the discussion
"actionRequest.getContentType() returning text/xml; charset=UTF-8"
To view the discussion, visit: http://community.jboss.org/message/537066#537066
--------------------------------------------------------------
hi all
when accessing requestParamets from jsp with enctype="multipart/form-data" in portlet,
actionRequest.getContentType() is returning text/xml; charset=UTF-8 not returing multipart.
in jsp
<form id="uploadform" name="frmnewmail" method="post" action="<%=actionURL%>" *enctype="multipart/form-data"*>
in portlet
public void processAction(ActionRequest actionRequest, ActionResponse actionResponse)
throws PortletException, IOException
{
// this if condition not returing true for multi part
*if(actionRequest.getContentType() != null && actionRequest.getContentType().startsWith("multipart"))
* {
portletFileUpload = new PortletFileUpload(actionRequest);
portletFileUpload.initialize();
}
// this if condition also not executing for multi part
i*f (PortletDiskFileUpload.isMultipartContent(actionRequest))*
{
}
}
Any help regarding this,
Thanks in advance
Raju.k
--------------------------------------------------------------
Reply to this message by going to Community
[http://community.jboss.org/message/537066#537066]
Start a new discussion in JBoss Portal at Community
[http://community.jboss.org/choose-container!input.jspa?contentType=1&cont...]
16 years