[JBoss Seam] - Forced Outjection
by c_eric_ray
I have the following situation...
| 1. user logs in
| 2. user object is outjected
| 3. work is done
| 4. backend process updates user in database
| 5. bean notices user update and refreshed from database
|
|
| I need the refreshed user data to be outjected however it is not
|
|
| | public class LoginAction {
| | private UserEntity user;
| |
| | @Out(required=false, scope=ScopeType.SESSION)
| | public String getUser() {
| | return user;
| | }
| | }
| |
| | public class AnotherBean {
| | @In(required=false) @Out
| | private UserEntity user;
| |
| | public void method() {
| | // update user with current data and have it outjected to other objects
| | user = em.find(UserEntity.class, user.getId());
| | }
| | }
| |
| | public class ThirdBean {
| | @In(required=false)
| | private UserEntity user;
| |
| | public void method() {
| | // do something with user
| | // however user contains the old data not the new data from the database
| | }
| | }
| |
|
| Is this possible? Am I doing it wrong? I guess I can always go to the database, but I kind of like the idea of using seam to manage this object.
|
| Thanks.
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=3999585#3999585
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=3999585
19 years, 3 months
[JBoss Portal] - Re: securing a page
by PeterJ
Here is an example, a portal with two pages, and how you would set up two roles such that one role can see both pages, the other can see only one page.
role1 role2 unchecked
| PortalA viewrecursive view --
| page1 --- view --
| page --- --- --
Key points:
* role1 has viewrecursive set at the portal level thus has access to all pages. No need to set access control on individual pages
* role2 has view access to portal and page1, thus cannot see page 2 (it will not show up in the navigation tabs)
* unchecked is not granted any access rights. This is important because if, for example. unchecked is granted view rights on page2, then role2 can see page2. (If a role is not granted specific access to a page, then the access rights granted to the "unchecked" role is used.)
My recommendation however, is to not set any portal access right, and instead set them all at the page level:
role1 role2 unchecked
| PortalA --- --- --
| page1 view view --
| page view --- --
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=3999583#3999583
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=3999583
19 years, 3 months
[JBoss Seam] - Re: @Out frustration
by c_eric_ray
"CptnKirk" wrote : @Out's scope defaults to the scope of the enclosing controller, in this case the SLSB. SLSB have a stateless scope. I think that Seam may actually promote the outjection of context variables of stateless components to event scope for you (but I'm not positive).
|
| Event scope is like JSP request scope and page scope is like JSP page scope. My guess is this example didn't work for you because you used navigation in your JSF action. If so, your view came in two requests. The first outjected the Bean, then left scope. Then you made the next request to view the page and saw everthing with their original values.
|
| I hope this clears up the scoping question.
I'm experiencing this very problem(although, I'm using SFSB). The only way I can get my application to work with outjection is to set everything to SESSION scope. I do use page navigation and as soon as I change scope to anythign less than SESSION, nothing gets outjected.
In another post Gavin says SESSION scope is bad and it is a memory leak. Now I'm really worried. How do you solve this problem?
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=3999581#3999581
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=3999581
19 years, 3 months
[JBoss Portal] - AJAX4JSF
by lixopmstp
Hi,
When I deploy my application on JBoss Portal Server 2.4 (happens on 2.6DR1 as well) I get an error (details below) and my AJAX4JSF stuff doesn't work. However when I deploy it on regular JBoss AS (4.0.4 SP1) it works just fine.
Apparently Portal Server has a problem with the AJX4JSF filter and <listener-class> tag which *is* in the web.xml even though I see this in the log files:
2007-01-08 14:55:41,000 ERROR [org.apache.catalina.core.ContainerBase.[jboss.web].[localhost].[/web]] Exception starting filter ajax4jsf
java.lang.IllegalStateException: No Factories configured for this Application - typically this is because a context listener is not setup in your web.xml.
A typical config looks like this;
<listener-class>org.apache.myfaces.webapp.StartupServletContextListener</listener-class>
A quick googling seems to indicate this is a JBoss Portal Server bug. Is this true? If so, are there any workarounds short of not using AJAx4JSF? Any time frame for this to be fixed? Maybe in 2.6 Alpha?
TIA!
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=3999580#3999580
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=3999580
19 years, 3 months
[Beginners Corner] - Re: JBoss, Tomcat and J2EE
by PeterJ
J2EE (or now Java EE) is a specification (or perhaps more accurately, a collection of many specifications). When you download the J2EE SDK from the Sun web site, it comes with a reference application server. That is, an application server that is built to the spec and is to be used as a reference guide for others wanting to build application servers, or to build applications to deploy to such servers. The reference server is not intended to be used in production (at least, it was not before, not sure if that is still a true statement).
Tomcat is also a reference server, but for the JSP and Servlet specs (note that this is not full J2EE). Even though it is a reference implementation, it is robust enough to use in a production environment.
JBoss uses Tomcat to handle servlets and JSPs, and adds to that all of the other services necessary to be J2EE compliant. In addition, it contains all of the jar files necessary to build J2EE applications. In other words, you do not need to download the J2EE SDK from Sun to build J2EE apps, you can just as easily download JBoss and use it for building J2EE apps.
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=3999578#3999578
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=3999578
19 years, 3 months