[JBoss Seam] - Seam over JSF 1.2 performance
by mgrouch
I've added tomahawk 1.1.6 and wrapped document using tomahawk
t:document. App is using JSF 1.2 and Seam 1.3.0.A on JBoss 4.2.
The rendering works noticably faster, not sure why though.
Might be Seam development team could look at that and if performance
is indeed better Seam could be improved so no tomahawk is needed (I do not use tomahawk for anything else in my app, and no myfaces JSF implementation at all).
anonymous wrote :
| <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
| <f:view xmlns="http://www.w3.org/1999/xhtml"
| xmlns:ui="http://java.sun.com/jsf/facelets"
| xmlns:h="http://java.sun.com/jsf/html"
| xmlns:t="http://myfaces.apache.org/tomahawk"
| xmlns:f="http://java.sun.com/jsf/core"
| xmlns:s="http://jboss.com/products/seam/taglib">
| <t:document>
| <t:documentHead>
| <meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
| Seam App
|
| </t:documentHead>
| <t:documentBody>
| <ui:include src="menu.xhtml">
| </ui:include>
|
| <ui:insert name="body"/>
|
| </t:documentBody>
| </t:document>
| </f:view>
|
Added into
web.xml
| <filter>
| <filter-name>MyFacesExtensionsFilter</filter-name>
| <filter-class>org.apache.myfaces.webapp.filter.ExtensionsFilter</filter-class>
| <init-param>
| <param-name>maxFileSize</param-name>
| <param-value>20m</param-value>
| <description>Set the size limit for uploaded files.
| Format: 10 - 10 bytes
| 10k - 10 KB
| 10m - 10 MB
| 1g - 1 GB
| </description>
| </init-param>
| </filter>
|
| <!-- extension mapping for adding <script/>, <link/>, and other resource tags to JSF-pages -->
| <filter-mapping>
| <filter-name>MyFacesExtensionsFilter</filter-name>
| <!-- servlet-name must match the name of your javax.faces.webapp.FacesServlet entry -->
| <servlet-name>Faces Servlet</servlet-name>
| </filter-mapping>
|
| <!-- extension mapping for serving page-independent resources (javascript, stylesheets, images, etc.) -->
| <filter-mapping>
| <filter-name>MyFacesExtensionsFilter</filter-name>
| <url-pattern>/faces/myFacesExtensionResource/*</url-pattern>
| </filter-mapping>
|
|
|
| <context-param>
| <param-name>org.apache.myfaces.ADD_RESOURCE_CLASS</param-name>
| <param-value>org.apache.myfaces.component.html.util.StreamingAddResource</param-value>
| </context-param>
| <context-param>
| <param-name>org.apache.myfaces.COMPRESS_STATE_IN_SESSION</param-name>
| <param-value>false</param-value>
| </context-param>
| <context-param>
| <param-name>org.apache.myfaces.SERIALIZE_STATE_IN_SESSION</param-name>
| <param-value>false</param-value>
| </context-param>
| <context-param>
| <param-name>org.apache.myfaces.NUMBER_OF_VIEWS_IN_SESSION</param-name>
| <param-value>20</param-value>
| <description>Only applicable if state saving method is "server" (= default).
| Defines the amount (default = 20) of the latest views are stored in session.
| </description>
| </context-param>
|
|
|
added commons-fileupload-1.2.jar into WEB-INF/lib
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4057149#4057149
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4057149
18Â years, 10Â months
[EJB 3.0] - weird problem with loading collections of subclasses
by tuxzilla
I have a class Listing with two collections reviews and discussions. Both Review and Discussion are subclasses mapped to the same table, distinguished by a discriminator column type. I am using Seam 1.2.1 but the problem is most likely related to the persistence mapping. Here are the mappings:
| @Entity
| @Name("listing")
| public class Listing implements java.io.Serializable {
| ...
|
| @OneToMany(targetEntity = Review.class, cascade = CascadeType.ALL, fetch = FetchType.LAZY, mappedBy = "listing")
| private Set<Review> reviews = new HashSet<Review>(0);
|
| @OneToMany(targetEntity = Discussion.class, cascade = CascadeType.ALL, fetch = FetchType.LAZY, mappedBy = "listing")
| private Set<Discussion> discussions = new HashSet<Discussion>(0);
|
| }
|
|
and
| @Entity
| @Name("review")
| @DiscriminatorValue("review")
| @Indexed(index="review")
| public class Review extends com.n2.bo.UserContent implements java.io.Serializable {
| ...
| @ManyToOne(fetch = FetchType.LAZY)
| @JoinColumn(name = "listingId")
| private Listing listing;
| }
|
|
| @Entity
| @Name("discussion")
| @DiscriminatorValue("discussion")
| @Indexed(index="discussion")
| public class Discussion extends com.n2.bo.UserContent implements java.io.Serializable {
| ...
| @ManyToOne(fetch = FetchType.LAZY)
| @JoinColumn(name = "listingId")
| private Listing listing;
| }
|
| @Entity
| @Table(name = "user_content")
| @Name("userContent")
| @Inheritance(strategy = InheritanceType.SINGLE_TABLE)
| @DiscriminatorColumn(name = "type",
| discriminatorType = DiscriminatorType.STRING)
| public class UserContent implements java.io.Serializable {
| ...
| }
|
|
The problem I have is that we I load either reviews or discussions of a listing, both reviews and discussions are loaded into one collection, without checking for discriminator value. I verified this with sql statement there was no where type='review' or where type='discussion' clause. Any idea why?
Thanks.
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4057147#4057147
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4057147
18Â years, 10Â months