[JBoss Seam] - Re: A couple of observations
by petemuir
"iradix" wrote :
| 1)I haven't found a good way to instantiate multiple, unique Seam components of the same type. As a use case say that I have a ProductFinder SFSB that uses multiple CategoryFilter objects to narrow down a result list. I can't create a subclass of CategoryFilter for each type of category because the categories are dynamically defined, and I'd like them to be Seam components so that they can take advantage of bijection and all the other Seam goodies. What I've been doing in this situation is using Component.newInstance(), but besides the fact that Gavin indicated that wasn't a great idea, it doesn't really seam suited to the task anyway. For one thing, newInstance() will cause an outjection of the created component after it is created, which is not really something I'm interested in for this scenario. Why clutter up any context when the bean is just used internally by the containing class? This isn't much of a problem with EJBs since they can be retrieved outside of seam and still be intercepted, but how about a method like T Component.newInstance(Class beanClass) to instantiate a CGLIB enhanced bean of any class with a no-arg constructor? The instantiated bean wouldn't even have to be named since it won't be outjected. Or at least public access to the methods on Component necessary to do something like that would be helpful.
I can see uses for this, but remember you can do bijection etc. through Component and the Context. Since you're creating a reusable component this might be a better way to do it as it allows you to specify context variable names at runtime rather than compiletime. Is there anything you can do with Seam annotations that you can't with methods? Off the top of my head: DataBinder stuff perhaps (could be useful), Logger (which I would find useful to be able to access as Logger.getInstance(...) for these situations thus removing a commons-logging dependencies).
anonymous wrote : 2) Wouldn't the ability to define an automatic naming convention be nice? Something like the type of pattern Log4J gives you to output a portion of a class name? Generally, I'm naming all of my beans to be the camel case class name with a lowercase first character and this would help with refactoring as well as stupid mistakes like copying a similar object and forgetting to change the name. Hopefully I'm not the only one who does things like that. Basically, all you would have to do is give the component a @Name annotation with no value to get the default. I'd imagine the naming convention could be defined in seam.properties.
Yeah. Something similar to the Hibernate Naming Strategy I think would be a good idea.
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=3963012#3963012
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=3963012
19 years, 9 months
[Security & JAAS/JBoss] - Re: JDBC Realm
by j2ee_junkie
bjornn,
You are making more work for yourself. I already told you that your query is not correct and pointed you to documentation on the LM. If the info you posted about your database is correct, and assuming your table names are USERS and ROLES, your queries should be as so...
| ...
| <module-option name = "principalsQuery">SELECT PASSWORD FROM USERS WHERE LOGIN=?</module-option>
| <module-option name = "rolesQuery">SELECT ROLE_NAME, 'Roles' FROM ROLES WHERE LOGIN=?</module-option>
| ...
|
The example for jms is just that, an example. You must customize the queries to match your database. Also, since you have gone down the road of changing your datasource, make sure your datasource points to your database.
cgriffith
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=3963010#3963010
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=3963010
19 years, 9 months
[JBoss Portal] - deploying portlets - changes between 2.2 and 2.4?
by taiji3
I recently started experimenting with JBoss and installed a few months ago the 2.2 version. Through try and error and looking at samples, I figured out how to code simple portlets and successfully deploy them with the required xml files.
Now I have downloaded the latest 2.4 version and find that - though my portlets run - I get something like the following at deploy time:
16:37:25,549 INFO [PortletAppDeployment] These instances have been found in -object.xml, you should put them in the file /home/jet/jboss-portal-2.4.0-CR3/server/default/./tmp/deploy/tmp64904HelloTherePortlet-exp.war/WEB-INF/portlet-instances.xml
16:37:25,550 INFO [PortletAppDeployment] <?xml version="1.0" encoding="utf-8" standalone="yes"?>
<instance-id>HelloTherePortletInstance</instance-id>
<portlet-ref>HelloTherePortlet</portlet-ref>
Has there been a change in the way deployment xml files should be written? I have not been able to find any resource that explains what files JBoss requires/desires and how they should look.
And help would be immensely appreciated!
(After previewing this post, some of it is being interpreted as xml and so not showing up, but I think it is clear enough as it is.)
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=3963003#3963003
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=3963003
19 years, 9 months