[JBoss Seam] - Re: [newbie] Problem passing parameters
by german.otero
Ok, In this example, we have a MessageManagerBean that is Session scopped. so it has the reference, is the same as the entityHome. or any Session Bean then holds the reference. this session bean, will have the reference to my selected object, until the end of my session.. or i need to say to him Hey destroy anything because i finish my work..
On the other hand suppouse that when i click the view/edit button, open a popUp window, so a single user, with single session, can open 2 AType for edit.... 2 windows, 1 session bean... ERR.... it must be other way to pass object form one page to other.. thinking that i do not have a conversation...
i'm starting a conversation, with an object.
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4111970#4111970
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4111970
18 years, 4 months
[JBoss Seam] - [newbie] timezones and s:convertDateTime
by mars1412
I want the user to select a timezone and then display a the server systemdate in the users timezone...
switching the timezone seems to work, but the page will always display the same date, no matter, which timezone I select.
first I wrote a small stateless bean, to get the available timezones and the current date:
| @Stateless
| @Name("timeZoneUtil")
| public class TimeZoneUtil implements Serializable, TimeZoneUtilInterface {
|
| public List<SelectItem> getTimeZones() {
| String[] timeZoneIDs = java.util.TimeZone.getAvailableIDs();
| List<SelectItem> selectItems = new ArrayList<SelectItem>(
| timeZoneIDs.length);
| for (String name : timeZoneIDs) {
| selectItems.add(new SelectItem(name, name));
| }
| return selectItems;
| }
|
| public Date getCurrentDateTime() {
| return new Date();
| }
| ...
| }
|
in the webpage, I use the standard seam functions to switch the locale and display the date/time:
| <h:form id="change_tz">
| <h:selectOneMenu value="#{timeZoneSelector.timeZoneId}">
| <f:selectItems value="#{timeZoneUtil.timeZones}"/>
| </h:selectOneMenu>
| <h:commandButton action="#{timeZoneSelector.select}" value="Timezone"/>
| </h:form>
|
| <div>CurrentDateTime:
| timezone: #{timeZoneSelector.timeZone}
| <p>
| <h:outputText value="#{timeZoneUtil.currentDateTime}">
| <s:convertDateTime type="both" dateStyle="full"/>
| </h:outputText>
| </p>
| </div>
|
Switching the locale seems to work, but the page will always display the same date!?
e.g.
anonymous wrote :
| CurrentDateTime: timezone: sun.util.calendar.ZoneInfo[id="Etc/GMT+10",offset=-36000000,dstSavings=0,useDaylight=false,transitions=0,lastRule=null]
|
| Dienstag, 11. Dezember 2007 16:22:04
|
some seconds later:
anonymous wrote :
| CurrentDateTime: timezone: sun.util.calendar.ZoneInfo[id="Etc/GMT+12",offset=-43200000,dstSavings=0,useDaylight=false,transitions=0,lastRule=null]
|
| Dienstag, 11. Dezember 2007 16:22:39
|
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4111969#4111969
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4111969
18 years, 4 months
[JBoss Seam] - Re: Problems with contexts not being active
by bmc
I have just the same problem with ContextFilter as akwatters. I use seam 2.0.GA and Jboss 4.2.2.
I want to get access to seam component from my servlet (catalogDispatcher), so I add org.jboss.seam.web.ContextFilter before my servlet and call
| Component.getInstance("myComponentName");
|
Everything works fine, but when my servlet ends doGet function execution - error appears:
| 18:23:16,588 ERROR [[catalogDispatcher]] Servlet.service() for servlet catalogDi
| spatcher threw exception
| java.lang.IllegalStateException: No active event context
| at org.jboss.seam.core.Manager.instance(Manager.java:248)
| at org.jboss.seam.servlet.ContextualHttpServletRequest.run(ContextualHtt
| pServletRequest.java:55)
| at org.jboss.seam.web.ContextFilter.doFilter(ContextFilter.java:37)
| at org.jboss.seam.servlet.SeamFilter$FilterChainImpl.doFilter(SeamFilter
| .java:69)
| at org.ajax4jsf.webapp.BaseXMLFilter.doXmlFilter(BaseXMLFilter.java:141)
|
| at org.ajax4jsf.webapp.BaseFilter.doFilter(BaseFilter.java:281)
| at org.jboss.seam.web.Ajax4jsfFilter.doFilter(Ajax4jsfFilter.java:60)
| at org.jboss.seam.servlet.SeamFilter$FilterChainImpl.doFilter(SeamFilter
| .java:69)
| at org.jboss.seam.web.LoggingFilter.doFilter(LoggingFilter.java:58)
| at org.jboss.seam.servlet.SeamFilter$FilterChainImpl.doFilter(SeamFilter
| .java:69)
| at org.jboss.seam.debug.hot.HotDeployFilter.doFilter(HotDeployFilter.jav
| a:68)
| at org.jboss.seam.servlet.SeamFilter$FilterChainImpl.doFilter(SeamFilter
| .java:69)
| at org.jboss.seam.servlet.SeamFilter.doFilter(SeamFilter.java:158)
| at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(Appl
| icationFilterChain.java:235)
| at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationF
| ilterChain.java:206)
| at org.jboss.web.tomcat.filters.ReplyHeaderFilter.doFilter(ReplyHeaderFi
| lter.java:96)
| at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(Appl
| icationFilterChain.java:235)
| at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationF
| ilterChain.java:206)
| at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperV
| alve.java:230)
| at org.apache.catalina.core.StandardContextValve.invoke(StandardContextV
| alve.java:175)
| at org.jboss.web.tomcat.security.SecurityAssociationValve.invoke(Securit
| yAssociationValve.java:179)
| at org.apache.catalina.authenticator.AuthenticatorBase.invoke(Authentica
| torBase.java:433)
| at org.jboss.web.tomcat.security.JaccContextValve.invoke(JaccContextValv
| e.java:84)
| at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.j
| ava:128)
| at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.j
| ava:104)
| at org.apache.catalina.valves.AccessLogValve.invoke(AccessLogValve.java:
| 543)
| at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineVal
| ve.java:109)
| at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.jav
| a:241)
| at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java
| :844)
| at org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.proce
| ss(Http11Protocol.java:580)
| at org.apache.tomcat.util.net.JIoEndpoint$Worker.run(JIoEndpoint.java:44
| 7)
| at java.lang.Thread.run(Thread.java:619)
|
Web.xml
| <?xml version="1.0" encoding="UTF-8"?>
| <!DOCTYPE web-app PUBLIC "-//Sun Microsystems, Inc.//DTD Web Application 2.3//EN" "http://java.sun.com/dtd/web-app_2_3.dtd">
| <web-app>
| <display-name>bestmemory</display-name>
|
| <filter>
| <filter-name>Seam Context Filter</filter-name>
| <filter-class>org.jboss.seam.web.ContextFilter</filter-class>
| </filter>
|
| <context-param>
| <param-name>org.ajax4jsf.VIEW_HANDLERS</param-name>
| <param-value>com.sun.facelets.FaceletViewHandler</param-value>
| </context-param>
|
| <listener>
| <listener-class>org.jboss.seam.servlet.SeamListener</listener-class>
| </listener>
|
| <servlet>
| <servlet-name>Seam Resource Servlet</servlet-name>
| <servlet-class>org.jboss.seam.servlet.SeamResourceServlet</servlet-class>
| </servlet>
|
| <servlet-mapping>
| <servlet-name>Seam Resource Servlet</servlet-name>
| <url-pattern>/seam/resource/*</url-pattern>
| </servlet-mapping>
|
| <filter>
| <filter-name>Seam Filter</filter-name>
| <filter-class>org.jboss.seam.servlet.SeamFilter</filter-class>
| </filter>
|
| <filter-mapping>
| <filter-name>Seam Filter</filter-name>
| <url-pattern>/*</url-pattern>
| </filter-mapping>
|
| <!-- JSF -->
|
| <context-param>
| <param-name>javax.faces.DEFAULT_SUFFIX</param-name>
| <param-value>.xhtml</param-value>
| </context-param>
|
| <context-param>
| <param-name>facelets.DEVELOPMENT</param-name>
| <param-value>true</param-value>
| </context-param>
|
| <context-param>
| <param-name>facelets.BUFFER_SIZE</param-name>
| <param-value>8192</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>*.seam</url-pattern>
| </servlet-mapping>
|
| <session-config>
| <session-timeout>10</session-timeout>
| </session-config>
|
| <servlet>
| <servlet-name>catalogDispatcher</servlet-name>
| <servlet-class>akcent.application.request.CatalogDispatcher</servlet-class>
| </servlet>
|
| <servlet-mapping>
| <servlet-name>catalogDispatcher</servlet-name>
| <url-pattern>/catalog/*</url-pattern>
| </servlet-mapping>
| <filter-mapping>
| <filter-name>Seam Context Filter</filter-name>
| <url-pattern>/catalog/*</url-pattern>
| </filter-mapping>
| <servlet-mapping>
| <servlet-name>catalogDispatcher</servlet-name>
| <url-pattern>/goods/*</url-pattern>
| </servlet-mapping>
| <filter-mapping>
| <filter-name>Seam Context Filter</filter-name>
| <url-pattern>/goods/*</url-pattern>
| </filter-mapping>
| </web-app>
|
components.xml
| <?xml version="1.0" encoding="UTF-8"?>
| <components xmlns="http://jboss.com/products/seam/components"
| xmlns:core="http://jboss.com/products/seam/core"
| xmlns:web="http://jboss.com/products/seam/web"
| xmlns:security="http://jboss.com/products/seam/security"
| xmlns:persistence="http://jboss.com/products/seam/persistence"
| xmlns:transaction="http://jboss.com/products/seam/transaction"
| xmlns:async="http://jboss.com/products/seam/async"
| xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
| xsi:schemaLocation=
| "http://jboss.com/products/seam/core http://jboss.com/products/seam/core-2.0.xsd
| http://jboss.com/products/seam/web http://jboss.com/products/seam/web-2.0.xsd
| http://jboss.com/products/seam/persistence http://jboss.com/products/seam/persistence-2.0.xsd
| http://jboss.com/products/seam/transaction http://jboss.com/products/seam/transaction-2.0.xsd
| http://jboss.com/products/seam/async http://jboss.com/products/seam/async-2.0.xsd
| http://jboss.com/products/seam/security http://jboss.com/products/seam/security-2.0.xsd
| http://jboss.com/products/seam/components http://jboss.com/products/seam/components-2.0.xsd">
|
| <core:init jndi-pattern="myapp/#{ejbName}/local" debug="true"/>
|
| <core:manager conversation-timeout="120000"
| concurrent-request-timeout="500"
| conversation-id-parameter="cid"/>
|
| <transaction:ejb-transaction/>
|
| <async:quartz-dispatcher/>
|
| <persistence:managed-persistence-context name="entityManager"
| auto-create="true"
| persistence-unit-jndi-name="java:/EntityManagerFactories/myapp"/>
| </components>
|
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4111968#4111968
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4111968
18 years, 4 months
[JBoss Seam] - [newbie] Problem passing parameters
by german.otero
Hi, i'm new with Seam, and i have a problem passing object between pages.
I have a grid, at the home of my app, and a view/edit action (row action.). Simple when a user click this link, i need to go to another page, this new page, must be fill with the object behind the row.
ej: the row has an object 'AType', and i go to the ATypeEdit.xhtml. so when i click the action to edit the AType, the new page rendered must have the AType info.
I found several ways to do this,
1) with <param ..../> but, i pass the id of the AType, or something that i can use to find it in the DB. If the object is transient???..
2) a session bean, call it, whatever you want (home, session bean o anything), that holds the object.... this is a little ugly. because, who will clean this reference??..and this SessionObject, have nothing to do here.
3) there is no 3..
I need a way to say, Hey, AType, Go there. ----> and the aType go.
Tnks.
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4111958#4111958
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4111958
18 years, 4 months