Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Db tuning #5

Open
wants to merge 9 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
47 changes: 47 additions & 0 deletions examples/jsf/numberguess/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -103,6 +103,53 @@
</plugins>
</build>
</profile>
<profile>
<id>jboss6-jsf12</id>
<dependencies>
<dependency>
<groupId>javax.annotation</groupId>
<artifactId>jsr250-api</artifactId>
<scope>provided</scope>
</dependency>
<dependency>
<groupId>javax.faces</groupId>
<artifactId>jsf-api</artifactId>
<scope>provided</scope>
</dependency>
<dependency>
<groupId>com.sun.facelets</groupId>
<artifactId>jsf-facelets</artifactId>
<version>${facelets.version}</version>
</dependency>
<dependency>
<groupId>org.glassfish.web</groupId>
<artifactId>el-impl</artifactId>
<scope>runtime</scope>
<exclusions>
<exclusion>
<groupId>javax.el</groupId>
<artifactId>el-api</artifactId>
</exclusion>
</exclusions>
</dependency>
</dependencies>
<build>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-war-plugin</artifactId>
<configuration>
<webResources>
<resource>
<directory>src/main/webapp-jboss5-jsf12</directory>
<filtering>true</filtering>
</resource>
</webResources>
</configuration>
</plugin>
</plugins>
</build>
</profile>
<profile>
<id>jboss5-servlet</id>

Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
<?xml version="1.0" encoding="UTF-8"?>
<faces-config version="1.2"
xmlns="http://java.sun.com/xml/ns/javaee"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="
http://java.sun.com/xml/ns/javaee
http://java.sun.com/xml/ns/javaee/web-facesconfig_1_2.xsd">

<name>numberguess</name>

<faces-config>
<application>
<view-handler>
com.sun.facelets.FaceletViewHandler
</view-handler>
</application>
</faces-config>

</faces-config>
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
<?xml version="1.0" encoding="UTF-8"?>
<web-app version="2.5"
xmlns="http://java.sun.com/xml/ns/javaee"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="
http://java.sun.com/xml/ns/javaee
http://java.sun.com/xml/ns/javaee/web-app_2_5.xsd">

<display-name>Web Beans Numberguess example</display-name>

<context-param>
<param-name>javax.faces.DEFAULT_SUFFIX</param-name>
<param-value>.xhtml</param-value>
</context-param>

<servlet>
<servlet-name>Faces Servlet</servlet-name>
<servlet-class>javax.faces.webapp.FacesServlet</servlet-class>
<load-on-startup>1</load-on-startup>
</servlet>

<servlet-mapping>
<servlet-name>Faces Servlet</servlet-name>
<url-pattern>*.jsf</url-pattern>
</servlet-mapping>

<session-config>
<session-timeout>10</session-timeout>
</session-config>

<context-param>
<param-name>org.jboss.jbossfaces.JSF_CONFIG_NAME</param-name>
<param-value>Mojarra-1.2</param-value>
</context-param>

</web-app>
Original file line number Diff line number Diff line change
Expand Up @@ -100,6 +100,7 @@ public String addCodeFragment(CodeFragment code, boolean privateFragment)
else
{
entityManager.persist(code);
entityManager.flush();
event.fire(code);
// Make sure we have the latest version (with the generated id!)
entityManager.refresh(code);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,11 @@
<provider>org.hibernate.ejb.HibernatePersistence</provider>
<jta-data-source>java:/pastecodeDatasource</jta-data-source>
<properties>
<!-- Hibernate specific properties -->
<!-- <property name="hibernate.cache.provider_class" value="org.hibernate.cache.EhCacheProvider" />-->
<property name="hibernate.cache.use_second_level_cache" value="true" />
<property name="hibernate.ejb.classcache.org.jboss.weld.examples.pastecode.model.CodeFragment" value="read-only"/>
<property name="hibernate.cache.use_query_cache" value="true" />
<property name="hibernate.hbm2ddl.auto" value="create-drop"/>
<property name="hibernate.show_sql" value="false"/>
</properties>
Expand Down
14 changes: 3 additions & 11 deletions examples/jsf/pastecode/src/main/webapp/rightMenuDefault.xhtml
Original file line number Diff line number Diff line change
Expand Up @@ -3,21 +3,13 @@
xmlns:h="http://java.sun.com/jsf/html"
xmlns:f="http://java.sun.com/jsf/core"
xmlns:ui="http://java.sun.com/jsf/facelets">

<ui:composition>

<div class="recentPastes">
<div class="recentPastesHeader">Recent pastes</div>
</div>

<ui:repeat value="#{recentCodeFragments}" var="codeFragment">
<div class="recentPaste">
<h:outputLink id="user" value="#{codeFragment.id}">#{codeFragment.user}</h:outputLink>
<span class="recentPasteLang">#{codeFragment.language.name}</span><span> | </span>#{codeFragment.friendlyDate}
</div>
</ui:repeat>
</ui:composition>

</div>

</ui:composition>

</html>
1 change: 1 addition & 0 deletions examples/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -88,6 +88,7 @@
<properties>
<!-- Override JSF version to 2.0 -->
<jsf.version>2.0.2-FCS</jsf.version>
<facelets.version>1.1.15</facelets.version>
<jetty.version>6.1.21</jetty.version>
<!-- UEL Impl -->
<uel.version>2.2</uel.version>
Expand Down