[JBoss Seam] - Re: Seam security adds default messages
by onyii5119
"fernando_jmt" wrote : The messages you should add to your .properties file are
|
| org.jboss.seam.loginSuccessful = Welcome, #0
|
| and
|
| org.jboss.seam.loginFailed = Login failed
|
|
| In case of login fails it is natural to add the message (which I can configure as I want), but in the case of the login is successfully not all cases it is required to add a success message.
|
| Is there a way in order to turn off the success message?
|
|
I am using a custom resource bundle (not the jsf style resource bundle) because of the requirements of our multi-language application. In that case what you recommended may not apply.
I tried setting my own message as shown below but got my own message and the default message ("Login failed") displayed as error messages. The result tells me that you set the error message only after the authenticate() method returns false.
Error messages displayed:
* Invalid username or password
* Login failed
in that order.
public boolean authenticate(){
try {
user = (TsUsersEntityBean) em.createQuery("from TsUsersEntityBean where userLoginId = :username")
.setParameter("username", identity.getUsername())
.getSingleResult();
}catch (NoResultException ex){
FacesMessages.instance().add("Invalid username or password");
return false;
}
To make the error handling more generic, I am recommending that you have methods that return and set the various messages. Your indentity class might be the appropriate class to add the methods - similar to Identity.addRole(String) method.
Hence, one can then set the appropriate message based on your specified key. For example: Identity.setLoginError("org.jboss.seam.loginFailed", "Invalid username or password"); The message set could be in any locale.
In your own code(seam code) if the user authenticate method returns false, you can then call Identity.getLoginError("org.jboss.seam.loginFailed"), if it returns null then set it to "Login failed" otherwise use the returned value.
Do a similar thing for all the other messages related to authentication (login). Doing so will make your authentication method usable by any locale.
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4031392#4031392
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4031392
19Â years
[JBoss Messaging] - Messaging Persistence and Multiple JBoss Instances
by rtm333
We are using several JBoss instances concurrently. The instances use identical topic names and share the same Sybase database. Non-persistent messages are "paged" into this database, when slow subscribers are not able to keep up with the high message generation rate.
It seems to us, that there is no isolation between the server instances. When we started a second instance while the already running first one had messages persisted to the database, message management of the first instance was disturbed. We suppose this happened due to the second instance trying to clean up the JMS_MESSAGE and JMS_MESSAGE_REF tables during startup.
What would be an appropriate way to isolate the instances against each other:
1) Use separate databases (actually, we would like to avoid this)?
2) Use unique JMS table names per instance?
3) Use differing topic names in the instances?
4) Augment all JMS tables by an additional column "INSTANCE_ID"?
Any comments and suggestions appreciated.
Actually, we even would prefer a more lightweight solution for message buffering than using a fullblown database for performance reasons (also see http://www.jboss.org/index.html?module=bb&op=viewtopic&t=104420 ).
In another thread ( http://www.jboss.org/index.html?module=bb&op=viewtopic&t=95035 ) of this forum someone suggested using Apache Derby as a replacement for file persistence. If this were used as in-process implementation, this should also easily solve our multi-instance problem mentioned above.
Anybody got experience with this product or something similar?
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4031388#4031388
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4031388
19Â years