[JBoss Seam] - Re: selectOneMenu - NPE
by w17chm4n
| @Stateful
| @Scope(ScopeType.SESSION)
| @Name("QuestionCategoryController")
| public class QuestionCategoryControllerBean implements QuestionCategoryController {
|
| @Logger
| private Log log;
|
| @In(create = true)
| private QuestionCategoryManager questionCategoryManager;
|
| @DataModel
| private List<QuestionCategory> questionCategoryList;
|
| @In(create = true)
| @DataModelSelection
| private QuestionCategory questionCategory;
|
| public void addCategory() {
| log.info("Adding category [#{questionCategory.categoryName}]");
| questionCategoryManager.addCategory(questionCategory);
| getAllQuestionsCategories();
| }
|
| public void removeCategory() {
| questionCategoryList.remove(questionCategory);
| questionCategoryManager.removeCategory(questionCategory);
| questionCategory = null;
| getAllQuestionsCategories();
| }
|
| @Factory(value="questionCategoryList")
| public void getAllQuestionsCategories() {
| questionCategoryList = questionCategoryManager.getAllQuestionCategories();
| }
|
| @Remove @Destroy
| public void destroy() {}
| }
|
Session context
| QuestionCategoryController
| QuestionController
| facelets.ui.DebugOutput
| javax.faces.request.charset
| org.jboss.seam.core.conversationEntries
| org.jboss.seam.international.localeSelector
| org.jboss.seam.international.timeZoneSelector
| org.jboss.seam.security.identity
| org.jboss.seam.web.session
| questionCategoryList
|
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4106251#4106251
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4106251
18 years, 8 months
[JBoss Seam] - why can't inject PresistenceContext into authenticator compo
by chitcool
Please comment on how to inject entityManager into Seam component action. And explain the way to call em.createQuery to check the db.
thank in advance.
package com.nov.session;
import org.jboss.seam.annotations.In;
import org.jboss.seam.annotations.Logger;
import org.jboss.seam.annotations.Name;
import org.jboss.seam.annotations.Scope;
import org.jboss.seam.log.Log;
import org.jboss.seam.security.Identity;
import org.jboss.seam.faces.FacesMessages;
import javax.persistence.EntityManager;
import javax.persistence.PersistenceContext;
import javax.persistence.NoResultException;
import java.util.List;
import javax.ejb.Stateless;
import static org.jboss.seam.ScopeType.EVENT;
import com.nov.entity.Customers;
@Name("authenticator")
public class Authenticator {
@Logger
Log log;
@In FacesMessages facesMessages;
@In
Identity identity;
public boolean authenticate() {
return true;
}
/*
@PersistenceContext
private EntityManager em;
public boolean authenticate() {
log.info("authenticating #0...^^^^^^^^username........................", identity.getUsername());
log.info("authenticating #0...^^^^^^^^^password........................", identity.getPassword());
try {
Customers customers = (Customers)em.createQuery("select u from Customers u where customers_email_address=:email_address and customers_password=:password")
.setParameter("email_address", identity.getUsername())
.setParameter("password", identity.getPassword())
.getSingleResult();
if (customers == null) {
return false;
}
identity.addRole("customers");
return true;
} catch (NoResultException ex){
log.info("authenticating #0...^^^^^^^^NORESULTEXCEPTION........................", ex.toString());
facesMessages.add("Invaild username and password. Username is your registered email address"); return false;
}
}
*/
}
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4106248#4106248
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4106248
18 years, 8 months
[JBoss Seam] - Re: PDF - is there a way?
by Kragoth
Ok, it is most certainly the IFrame that is the cause of pretty much all my grief.
I do not know of anyway of ensuring that the src attribute of the iframe will indeed join my current conversation... infact I don't even know where to begin in trying to do that.
I have succeeded in using a s:link tag to open my content in a new window and this is working! So for now I'm going to leave it at that unless someone can tell me how to get iframes working.... maybe we need a s:iframe component to allow for conversation propagation?
I would like to use iframes and I *know* that for the next phase of the application it will most likely be a must....although we may not use seam to generate the pdfs....we'll see.
s:iframe..... how hard would that be to implement?
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4106246#4106246
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4106246
18 years, 8 months
[Beginners Corner] - Re: ejb3 binding
by jaikiran
anonymous wrote : When i deploy it, my ejb are bind to "application/EjbName".
That's the default.
anonymous wrote : It is possible, remove the ear filename from the jndi, or change it?
Yes, its possible. You can specify any jndi name of your choice for the EJBs. You can either use annotations (for EJB3) or jboss.xml to do this. Here's an example using annotations:
@Stateless
| @Remote ({UserManager.class})
| @RemoteBinding (jndiBinding = "RemoteUserManagerBean")
| public class UserManagerBean implements UserManager {
| ....
| }
See the use of @RemoteBinding, above. With this annotation the UserManagerBean is now bound to "RemoteUserManagerBean" jndi name(you can specify any unique jndi name of your choice).
The other way to do this is adding an entry in the jboss.xml (as follows):
<session>
| <ejb-name>UserManagerBean</ejb-name>
| <jndi-name>RemoteUserManagerBean</jndi-name>
|
| </session>
For more details refer to the jboss.xml dtd.
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4106245#4106245
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4106245
18 years, 8 months