[JBoss Seam] - Undefined member variables with seam remoting
by andrew.rw.robinson
I am trying to send a hierarchy of java objects back to the JS client using Seam remoting. The call is working, I am getting the top level class back fine, but the data in that class is undefined. I have turned on debugging and the result looks fine to me. I am not sure what is wrong.
Return value:
public class WebRemotingReturnValue
| implements Serializable
| {
| private Object value;
| ...
| public Object getValue() { return this.value; }
| }
The "value" is an List of:
public class DashboardKpi
| {
| public String application;
| public String name;
| public long id;
| public String account;
| public String type;
| public boolean base;
|
| public DashboardKpi(UserKPI kpi, boolean isAccountBaseMember)
| {
| this.application = kpi.getApp();
| this.name = kpi.getName();
| this.id = kpi.getId();
| this.account = kpi.getAccount();
| this.type = kpi.getType().name();
| this.base = isAccountBaseMember;
| }
| ...
| }
When I get the result on the client "result.getValue()" returns an array of undefined references.
I'll post the debug in a second, the forum is having issues with it
Do you know why the array isn't being populated by my objects that are returned?
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4007030#4007030
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4007030
19 years, 2 months
[JBoss Seam] - Re: How are you handling login / registration redirects?
by christian.bauer@jboss.com
I use this (for similar functionality), which is better because it is conversation scoped (app works in several windows):
On every page I can get "back" to, I store it in a conversation scoped component with a page action in pages.xml:
| <page view-id="/docDisplay.xhtml" action="#{documentBrowser.prepare()}">
|
| @Name("documentBrowser")
| public class DocumentBrowser {
|
| @In
| protected org.jboss.seam.core.Redirect redirect;
|
| public String prepare() {
|
| // Store the view-id that called this method (as a page action) for return (exit of a later conversation)
| redirect.captureCurrentRequest();
| }
|
| /**
| * Executes a redirect to the last view-id that was prepare()ed.
| * <p>
| * Usually called after ending a conversation. Assumes that the caller of the method does not want to propagate
| * the current (ended) conversation across that redirect. Also removes any stored <tt>actionOutcome</tt>,
| * <tt>actionMethod</tt> or <tt>cid</tt> request parameter before redirecting, we don't want to redirect to
| * a prepare()ed page that was in a long-running conversation (temporary doesn't matter) or that was last
| * called with an action (that action would probably send us straight back into the conversation we are trying
| * to redirect out of).
| */
| public void redirectToLastBrowsedPage() {
|
| // We don't want to redirect to an action, so if the last browsed page was called with an action, remove it
| redirect.getParameters().remove("actionOutcome");
| redirect.getParameters().remove("actionMethod");
|
| // If the last browsed page had a conversation identifier (we assume of a temporary conversation), remove it
| redirect.getParameters().remove("cid");
|
| // We also don't want to redirect the long-running conversation, the caller has ended it already
| redirect.setConversationPropagationEnabled(false);
|
| redirect.execute();
| }
|
| }
|
And I can then later exit a conversation like this and redirect to the last "prepared" page:
| <s:button id="exit" value="Exit Editor" styleClass="button" action="#{documentBrowser.redirectToLastBrowsedPage()}"
| propagation="end"/>
|
|
There is some more details to this overall navigation strategy, but that should get you started.
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4007023#4007023
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4007023
19 years, 2 months
[JBoss Seam] - Re: How are you handling login / registration redirects?
by felipevaa
Here is how I am handling the redirect to the login page and then back to the original page:
1) pages.xml:
| <page view-id="/directory/*" action="#{loginAction.checkLogin}"/>
|
2) loginAction.checkLogin():
| if( user is already logged in )
| {
| return null; // Do nothing (i. e.: proceed with pages.xml chain)
| }
| else
| {
| // Or else, store current view-id on session and redir user to login page
| Contexts.getSessionContext().set("viewIdAfterLogin",
| FacesContext.getCurrentInstance().getViewRoot().getViewId());
| return "/login.xhtml";
| }
|
3) loginAction.login():
| ... // after user and password was validated
|
| String viewIdToRedirect =
| (String)Contexts.getSessionContext().get("viewIdAfterLogin");
| Contexts.getSessionContext().set("viewIdAfterLogin", null);
| return viewIdToRedirect;
|
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4007021#4007021
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4007021
19 years, 2 months
[JBossCache] - Re: JBoss cache under SpringFramework
by bstansberry@jboss.com
What specifically do you mean? (I'm asking because we want to do what we can and I'd like to know what people want).
In 2.0.0 the configuration of a cache is done with a series of simple java beans and the instantiation of the cache is done via a factory, where the Configuration object is passed in to the factory method. If you have a look at the all/deploy/tc5-cluster.sar/META-INF/jboss-beans.xml in the AS 5 Beta1 download, you'll see an example of building up a Configuration object and using it to instantiate a cache. The IOC framework used there is the JBoss Microcontainer. I haven't tried it, but I don't see any reason why the same thing couldn't be accomplished with Spring. I want to do that and put an example up somewhere (wiki probably) but it will likely be a while before I get around to it.
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4007016#4007016
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4007016
19 years, 2 months