[JBoss Seam] - Re: Ending multiple nested conversations?
by vladimir.ralev@jboss.com
Actually it's better to use the instance methods
| /**
| * End a conversation together with all nested conversations. The
| * conversation passed in cid will be destroyed at the end of the
| * request while the nested conversations are destroyed immediately.
| *
| * @param cid the ID of the conversation
| */
| public void endConversationByID(String cid, boolean beforeRedirect)
| {
| log.debug("Ending long-running conversation");
|
| if ( Events.exists() ) Events.instance().raiseEvent("org.jboss.seam.endConversation");
|
| ConversationEntries ce = ConversationEntries.instance();
| setCurrentConversationId( cid );
| setCurrentConversationIdStack(
| ce.getConversationEntry( cid ).getConversationIdStack());
| setLongRunningConversation( false );
| destroyBeforeRedirect = beforeRedirect;
| endNestedConversations( cid );
| storeConversationToViewRootIfNecessary();
| }
|
with
| public String endParent()
| {
| Manager m = Manager.instance();
| m.endConversationByID(Conversation.instance().getParentId(), false);
| return "next.seam";
| }
|
| //Assuming conversations 1->2->3
| public String endParentOfParent()
| {
| Manager m = Manager.instance()
|
| // kill immediately 3, set Conversation.instance() to 2 and mark it to
| // be ended at the end of the request
| m.endConversationByID(Conversation.instance().getParentId(), false);
|
| // kill immediately 2, set Conversation.instance() to 1 and mark it to
| // be ended at the end of the request
| m.endConversationByID(Conversation.instance().getParentId(), false);
| return "next.seam";
| }
|
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4039600#4039600
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4039600
19 years
[JBoss Seam] - How to develop my first web app with seam, without EJB, withou
by Theface
Hi,all.
can you help me to develop my first web app,with seam,but without EJB and any DataBase(or called Datasource),Thanks very much at first.
I used the seam command to generate a project,but i think the folder structure is too bad,so i change the todo example to project login:
login
-src
--org.jboss.seam.example.todo.Login.java
-web
--index.html
--login.jsp
--WEB-INF
---web.xml
---components.xml
---faces-config.xml
---lib
----All lib from example folder(size is 23MB)---
and following is changed file:
----------------components.xml-----------------------------
<!DOCTYPE components PUBLIC
"-//JBoss/Seam Component Configuration DTD 1.2//EN"
"http://jboss.com/products/seam/components-1.2.dtd">
-----------faces-config.xml-----------------------
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE faces-config
PUBLIC "-//Sun Microsystems, Inc.//DTD JavaServer Faces Config 1.0//EN"
"http://java.sun.com/dtd/web-facesconfig_1_0.dtd">
<faces-config>
</faces-config>
I deployed this project to tomcat 5.5,and startup the sever.no exception throws,but when to show this page use /login/login.seam.the sever will throw many exception likes follow:
21:29:28,453 ERROR [ExceptionFilter] could not roll back transaction
javax.naming.NamingException: Local server is not initialized
at org.jnp.interfaces.LocalOnlyContextFactory.getInitialContext(LocalOnlyContextFactory.java:45)
at javax.naming.spi.NamingManager.getInitialContext(NamingManager.java:667)
at javax.naming.InitialContext.getDefaultInitCtx(InitialContext.java:288)
at javax.naming.InitialContext.init(InitialContext.java:223)
at javax.naming.InitialContext.(InitialContext.java:197)
at org.jboss.seam.util.Naming.getInitialContext(Naming.java:35)
at org.jboss.seam.util.Naming.getInitialContext(Naming.java:47)
at org.jboss.seam.util.Transactions.getUserTransaction(Transactions.java:149)
at org.jboss.seam.util.Transactions.isUTTransactionActiveOrMarkedRollback(Transactions.java:122)
at org.jboss.seam.util.Transactions.isTransactionActiveOrMarkedRollback(Transactions.java:50)
at org.jboss.seam.web.ExceptionFilter.rollbackTransactionIfNecessary(ExceptionFilter.java:128)
at org.jboss.seam.web.ExceptionFilter.doFilter(ExceptionFilter.java:63)
at org.jboss.seam.web.SeamFilter$FilterChainImpl.doFilter(SeamFilter.java:49)
at org.jboss.seam.web.RedirectFilter.doFilter(RedirectFilter.java:45)
at org.jboss.seam.web.SeamFilter$FilterChainImpl.doFilter(SeamFilter.java:49)
at org.jboss.seam.web.MultipartFilter.doFilter(MultipartFilter.java:79)
at org.jboss.seam.web.SeamFilter$FilterChainImpl.doFilter(SeamFilter.java:49)
at org.jboss.seam.web.SeamFilter.doFilter(SeamFilter.java:84)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:215)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:188)
at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:210)
at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:174)
at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:127)
at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:117)
at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:108)
at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:151)
at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:870)
at org.apache.coyote.http11.Http11BaseProtocol$Http11ConnectionHandler.processConnection(Http11BaseProtocol.java:665)
at org.apache.tomcat.util.net.PoolTcpEndpoint.processSocket(PoolTcpEndpoint.java:528)
at org.apache.tomcat.util.net.LeaderFollowerWorkerThread.runIt(LeaderFollowerWorkerThread.java:81)
at org.apache.tomcat.util.threads.ThreadPool$ControlRunnable.run(ThreadPool.java:685)
at java.lang.Thread.run(Thread.java:619)
but the login form is display in browser.
My english is too bad.so .I hope anyone can knows my means.
Thanks again.
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4039598#4039598
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4039598
19 years
[JBoss Seam] - Re: Ending multiple nested conversations?
by vladimir.ralev@jboss.com
Here is my solution:
Add this method to org.jboss.seam.core.Manager
| /**
| * End a conversation together with all nested conversations. The
| * conversation passed in cid will be destroyed at the end of the
| * request while the nested conversations are destroyed immediately.
| *
| * @param cid the ID of the conversation
| */
| public void endConversationByID(String cid, boolean beforeRedirect)
| {
| log.debug("Ending long-running conversation");
|
| if ( Events.exists() ) Events.instance().raiseEvent("org.jboss.seam.endConversation");
|
| ConversationEntries ce = (ConversationEntries)
| Component.getInstance("org.jboss.seam.core.conversationEntries");
| setCurrentConversationId( cid );
| setCurrentConversationIdStack(
| ce.getConversationEntry( cid ).getConversationIdStack());
| setLongRunningConversation( false );
| destroyBeforeRedirect = beforeRedirect;
| endNestedConversations( cid );
| storeConversationToViewRootIfNecessary();
| }
|
In the bean do this:
| public String endParent()
| {
| Manager m = (Manager)Component.getInstance("org.jboss.seam.core.manager");
| m.endConversationByID(Conversation.instance().getParentId(), false);
| return "next.seam";
| }
|
| //Assuming conversations 1->2->3
| public String endParentOfParent()
| {
| Manager m = (Manager)Component.getInstance("org.jboss.seam.core.manager");
|
| // kill immediately 3, set Conversation.instance() to 2 and mark it to
| // be ended at the end of the request
| m.endConversationByID(Conversation.instance().getParentId(), false);
|
| // kill immediately 2, set Conversation.instance() to 1 and mark it to
| // be ended at the end of the request
| m.endConversationByID(Conversation.instance().getParentId(), false);
| return "next.seam";
| }
|
The endParent() kills the current conversation immediately and the parent at the end of the request. If you want to kill the parent of the parent too, you can call endConversationByID against Conversation.instance().getParentId() because the current Conversation instance is actually the conversation scheduled to be destroyed at the end of the request.
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4039593#4039593
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4039593
19 years
[JBoss Seam] - Re: Seam saying Datamodel saying row is Unavailable... WHY??
by tony.herstell@gmail.com
Ok, I got it working by adding PAGE to the Models (No I have no idea why I needed to !)
| @DataModel(value="displayableCategoryDatamodel", scope=ScopeType.PAGE)
| private LinkedHashSet<DisplayableCategory> displayableCategorySet;
|
| @DataModelSelection(value="displayableCategoryDatamodel")
| private DisplayableCategory selectedDisplayableCategory;
|
| @DataModel(value="keywordsDatamodel", scope=ScopeType.PAGE)
| private LinkedHashSet<Keyword> keywordsSet;
|
| @DataModelSelection(value="keywordsDatamodel")
| private Keyword selectedKeyword;
|
anyhow,
So.. now I have this
|
| <h:dataTable var="eachKeyword" value="#{keywordsDatamodel}" rendered="#{keywordsDatamodel.rowCount>0}">
|
| <h:column>
| <f:facet name="header">
| <h:outputText value="#{messages.keyword}" />
| </f:facet>
| <h:outputText value="#{eachKeyword.keyword}" />
| </h:column>
|
| <h:column>
| <s:button value="#{messages.button_delete}"
| action="#{advertisingCampaignController.deleteKeyword(eachKeyword)}"/>
| </h:column>
| </h:dataTable>
|
|
Why am I getting null in the routine for deleteKeyword(eachKeyword)??? for eachKeyword?
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4039591#4039591
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4039591
19 years