[JBoss Seam] - End conversation after back button
by lightbulb432
I have a page that displays a list of entities. I click on one list element (an s:link with a page parameter), taking me to a page that uses the page parameter to display certain things about that entity.
I hit the back button, taking me to that initial list. I click another entity. However, even though the request parameter has changed, the page still has information about the same entity as the first time.
Because they're all conversation scoped elements, I'm using the following on the page with the list of elements to show the page in a new conversation:
<h:outputLink value="nextPage.seam">
#{listElement.name}
<f:param name="id" value="#{listElement.id}" />
<s:conversationPropagation propagation="none" />
</h:outputLink>
This doesn't seem to solve the problem. Is there something I'm not considering about the use of the back button and conversation propagation?
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4019175#4019175
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4019175
19Â years, 2Â months
[JNDI/Naming/Network] - newbie - Remote call not happening when ejb resides in same
by haribaasha
this is my code to lookup the ejb
private static Hashtable _jndiProperties = new Hashtable();
_jndiProperties.put( Context.INITIAL_CONTEXT_FACTORY, "org.jnp.interfaces.NamingContextFactory" );
_jndiProperties.put( Context.URL_PKG_PREFIXES , "org.jboss.naming:org.jnp.interfaces" );
_jndiProperties.put( Context.PROVIDER_URL, "localhost:1100" );
Context context = new InitialContext( _jndiProperties );
Object objref = context.lookup( "IndicativesEJB" );
RSIndicativeServiceHome indicServiceHome = (RSIndicativeServiceHome)PortableRemoteObject.narrow( objref, RSIndicativeServiceHome.class );
RSIndicativeServiceRemote indicServiceRemote = indicServiceHome.create();
indicResponse = indicServiceRemote.serviceRequest( param1, param2);
my setup is as follows :
3 jboss servers, with all three containing the ejb, when above code is invoked, the ejb from that local machine is only called, clustering/remote does not happen.
when ejb is removed from that machine, then remote call happens to the other two machines(clustering)
Cant the ejb reside in the same machine where the lookup happens?
what have i done wrong?
Hari
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4019171#4019171
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4019171
19Â years, 2Â months
[JBoss Seam] - Re: Problems Nesting <h:dataTable>
by gzoller
These classes can't derive from DataModel. In the real project they're Entities and have their own class hierarchy. Any solution needs to be a separate concern from the entity object model.
Based on some examples I saw in my seam-gen code I'm trying something a little different. I'm passing the entity id as a <f:param> in the <s:link> element. This is working on the outermost table but now my inner objects aren't rendering.
Here's my code:
| <ice:dataTable id="departmentListResults" width="100%" cellspacing="1"
| value="#{departmentList.resultList}"
| var="dept">
| <ice:column>
| <ice:dataTable id="projectListResults" width="100%" cellspacing="1"
| value="#{dept.projects}" var="proj">
| <ice:column>
| <!-- This is where my s:link and f:param would normally go...if the rendering was working. -->
| <ice:outputText value="Nothing here" rendered="#{proj == null}"/>
| <ice:outputText value="#{proj.projectId}" rendered="#{proj != null}"/>
| </ice:column>
| </ice:dataTable>
| </ice:column>
| <ice:dataTable>
|
departmentList is the seam-gen EntityQuery object that pulls back a list of Department objects (@Entity). Within each Department is a Set (1-m relationship between Department and Project).
I get a javax.faces.el.PropertyNotFoundException on proj.projectId. I can output just "#{proj}" and get something like this: com.foobar.spurs.model.Project@1bf446e, so I know there's a non-null Object there and its type is Project.
So why am I getting an exception when I try to access any of Project's properties? (There are full JavaBean getters/setters for each property I'm trying to access thanks to seam-gen.)
The strange thing is this rendering was working fine when my objects were trivial (non-Entity) classes, and I could easily access properties from the "inner" list (proj in this example).
Many thanks in advance for any ideas!
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4019170#4019170
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4019170
19Â years, 2Â months
[Performance Tuning] - Re: Best JVM memory size?
by PeterJ
Actually, if you allocate 1GB of heap, it will never all be used. For example, with a young generation of 300MB, once the heap size reaches 700MB, on the next GC a full GC will be done. Why? Because the Sun JVM makes the pessimistic assumption that all objects in the young generation will survive and thus overflow into the tenured generation, and in this case the tenured generation would overflow, therefore a full GC is performed. Therefore, 300MB of the allocated heap are never used. So that 300MB does not count towards the memory allocation; if it is swapped out, who cares? Actually, while the OS might reserve that memory, it might not ever allocate it, though it will count that memory towards total memory allocation.
By the way, I verified this behavior in the 1.4.2 JVM, and I think that it is still the same in 1.5, not sure about 1.6 though.
Another, probably more accurate estimate, would be to bring up the system and see how much memory is taken by services and the OS. Then allocate a heap size to what is left over. For example, when running FC 6 on my laptop with 2GB ram, I am using about 300MB memory for the OS and services. Thus the maximum JVM heap I would want to use is 1.7GB (2GB - 300MB). But like all tuning settings, this is simply an estimate for an initial size. One then has to take various measurements under load, and analyze those results, to find the optimal settings.
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4019151#4019151
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4019151
19Â years, 2Â months
[JBoss Seam] - Re: Seam Security and ICEFaces
by fernando_jmt
My faces-config.xml:
| <faces-config>
| <application>
| <message-bundle>messages</message-bundle>
| <view-handler>com.icesoft.faces.facelets.D2DSeamFaceletViewHandler</view-handler>
| <variable-resolver>org.jboss.seam.jsf.SeamVariableResolver</variable-resolver>
| </application>
| <!-- Seam extended transaction management -->
| <lifecycle>
| <phase-listener>org.jboss.seam.jsf.SeamExtendedManagedPersistencePhaseListener</phase-listener>
| </lifecycle>
|
| </faces-config>
|
My web.xhml:
| <web-app xmlns="http://java.sun.com/xml/ns/j2ee"
| xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
| xsi:schemaLocation="http://java.sun.com/xml/ns/j2ee http://java.sun.com/xml/ns/j2ee/web-app_2_4.xsd"
| version="2.4">
|
|
|
|
| <context-param>
| <param-name>javax.faces.STATE_SAVING_METHOD</param-name>
| <param-value>client</param-value>
| </context-param>
|
| <context-param>
| <param-name>facelets.DEVELOPMENT</param-name>
| <param-value>true</param-value>
| </context-param>
|
|
|
| <context-param>
| <param-name>javax.faces.DEFAULT_SUFFIX</param-name>
| <param-value>.xhtml</param-value>
| </context-param>
|
| <context-param>
| <param-name>facelets.SKIP_COMMENTS</param-name>
| <param-value>true</param-value>
| </context-param>
|
| <context-param>
| <param-name>com.icesoft.faces.actionURLSuffix</param-name>
| <param-value>.jsf</param-value>
| </context-param>
|
| <!-- concurrent DOM views -->
| <context-param>
| <param-name>com.icesoft.faces.concurrentDOMViews</param-name>
| <param-value>true</param-value>
| </context-param>
| <!-- Asynchronous Updates -->
| <context-param>
| <param-name>com.icesoft.faces.synchronousUpdate</param-name>
| <param-value>true</param-value>
| </context-param>
|
| <filter>
| <filter-name>Seam Filter</filter-name>
| <filter-class>org.jboss.seam.web.SeamFilter</filter-class>
| </filter>
|
|
|
| <listener-class>org.jboss.seam.servlet.SeamListener</listener-class>
| </listener>
|
| <listener>
| <listener-class>org.apache.myfaces.webapp.StartupServletContextListener</listener-class>
| </listener>
|
| <filter-mapping>
| <filter-name>Seam Filter</filter-name>
| <url-pattern>/*</url-pattern>
| </filter-mapping>
|
|
|
|
|
| <servlet>
| <servlet-name>Blocking Servlet</servlet-name>
| <servlet-class>com.icesoft.faces.webapp.xmlhttp.BlockingServlet</servlet-class>
| <load-on-startup>1</load-on-startup>
| </servlet>
|
| <servlet>
| <servlet-name>Persistent Faces Servlet</servlet-name>
| <servlet-class>com.icesoft.faces.webapp.xmlhttp.PersistentFacesServlet</servlet-class>
| <load-on-startup>1</load-on-startup>
| </servlet>
|
| <servlet-mapping>
| <servlet-name>Persistent Faces Servlet</servlet-name>
| <url-pattern>/xmlhttp/*</url-pattern>
| </servlet-mapping>
|
| <servlet-mapping>
| <servlet-name>Persistent Faces Servlet</servlet-name>
| <url-pattern>/xmlhttp/*</url-pattern>
| </servlet-mapping>
|
| <servlet-mapping>
| <servlet-name>Persistent Faces Servlet</servlet-name>
| <url-pattern>*.iface</url-pattern>
| </servlet-mapping>
|
| <!-- Blocking Servlet Mapping -->
| <servlet-mapping>
| <servlet-name>Blocking Servlet</servlet-name>
| <url-pattern>/block/*</url-pattern>
| </servlet-mapping>
|
| <!-- Faces Servlet Mapping -->
| <servlet-mapping>
| <servlet-name>Persistent Faces Servlet</servlet-name>
| <url-pattern>*.jsf</url-pattern>
| </servlet-mapping>
|
| <welcome-file-list>
| <welcome-file>index.html</welcome-file>
| </welcome-file-list>
|
|
| </web-app>
|
|
One note:
Above configuration, specially for Seam Filter is for Seam 1.1.6 CVS nightly build, if you want to use it, you should get a CVS copy of Seam and build it.
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4019149#4019149
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4019149
19Â years, 2Â months
[JBoss Seam] - Home Entity not Working
by bulloncito
... finally managed to use EntitiHome in my project, however this code works:
<factory name="user"
| value="#{userHome.instance}"/>
|
| <framework:entity-home name="userHome"
| entity-class="myPackage.User"
| entity-manager="#{entityManager}" />
while this one does not:
@Name("userHome")
| @Scope(ScopeType.CONVERSATION)
| public class UserHome extends EntityHome<User> {
|
| @In EntityManager entityManager ;
|
| @RequestParameter Long userId ;
|
| @Factory("user")
| public User initUser() { return getInstance() ; }
|
| @End
| public String persist() {
| super.persist() ;
| return "users" ;
| }
|
| @End
| public String update() {
| setId( userId ) ;
| super.update() ;
| return "users" ;
| }
|
| @End
| public String remove() {
| setId( userId ) ;
| super.remove() ;
| return "users" ;
| }
|
| @Destroy @Remove
| public void destroy() {}
|
| }
... everything else is the same.
... is this a bug ? or am I missing something ? I believe it's better to use inheritance to add some extra features by hand, but I can't :(
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4019144#4019144
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4019144
19Â years, 2Â months
[JBoss Seam] - Home Entity not partially working
by bulloncito
... finally managed to use EntitiHome in my project, however this code works:
<factory name="user"
| value="#{userHome.instance}"/>
|
| <framework:entity-home name="userHome"
| entity-class="myPackage.User"
| entity-manager="#{entityManager}" />
while this one does not:
@Name("userHome")
| @Scope(ScopeType.CONVERSATION)
| public class UserHome extends EntityHome<User> {
|
| @In EntityManager entityManager ;
|
| @RequestParameter Long userId ;
|
| @Factory("user")
| public User initUser() { return getInstance() ; }
|
| @End
| public String persist() {
| super.persist() ;
| return "users" ;
| }
|
| @End
| public String update() {
| setId( userId ) ;
| super.update() ;
| return "users" ;
| }
|
| @End
| public String remove() {
| setId( userId ) ;
| super.remove() ;
| return "users" ;
| }
|
| @Destroy @Remove
| public void destroy() {}
|
| }
... is this a bug ? or am I missing something ? I believe it's better to use inheritance to add some extra features by hand, but I can't :(
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4019140#4019140
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4019140
19Â years, 2Â months