[JBoss Seam] - tomcat seam and external app (SessionBean not bound)
by lschaffer
Hello
I have a seam app that I had to ported to tomcat(6) . Another web app (from jsp pages) should reach some service functions from the seam app
There is a simple stateless bean as a service proxy through external web clients can reach some business services
(Note: this is working with jboss 4.2)
the session bean
@Stateless
public class ServiceProxyBean implements ServiceProxy {
@EJB UserController userCnt;
@EJB PartnerController partnerCnt;
/**
...
the jsp ('normal' web app)
<%
try {
InitialContext ctx = new InitialContext();
serviceProxy=(ServiceProxy)ctx.lookup(
"madreg/ServiceProxyBean/local");
System.out.println("proxy ok");
and the jndi in this webapp
java.naming.factory.initial=org.jnp.interfaces.NamingContextFactory
java.naming.factory.url.pkgs=org.jboss.naming:org.jnp.interfaces
java.naming.provider.url=localhost
But in tomcat6 I got an exception "bean not bound in jndi"
Is there any workaround ?
Thanks
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4043988#4043988
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4043988
19 years
[JBoss Seam] - Re: CRUD screen
by Delphi's Ghost
If you are talking about CRUD using the Seam Framework (EntityHome and all that) then I believe the contact list example uses that particular method of crud.
If you are talking about writing your own set of CRUD pages, then there are a number of ways to do it.
In the Issues example - inject the issueFinder bean into the issueEdit bean and get the selected item from the issueFinder. (seems messy to me)
- or -
Use bijection to outject the selected item, and inject it into the edit bean
- or -
Use request parameters to pass the ID of the object to be edited to the editor page (best option for RESTful URLs) . The Seam blog uses this method.
- or -
Use EL Enhancements to pass the object from the list page to the edit bean from within the datatable : i.e.
| <s:link value="Edit" action="#{personEditBean.editPerson(person)/>
|
where "person" is the var value in your datatable. You can see this type of example in the hotel booking app with the "selectHotel(hot)" function in the hotel listing page. It starts the booking conversation and passes the hotel in using the "hot" variable from the datatable.
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4043983#4043983
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4043983
19 years
[JBoss Seam] - problem with s:selectItems and noSelectionLabel
by matt.drees
I have a simple array of strings backing an <s:selectItems> for an <h:selectOneMenu>. When I don't set noSelectionLabel, it works fine. It renders the options something like
| <option value="durango">durango</option>
|
However, when I set noSelectionLabel, the menu doesn't function, because the options are rendered like
<option>durango</option>
After some debugging, I found that the problem is in the ConverterChain that is attached to the HtmlSelectOneMenu component. JSF calls the converter to convert the value "durango" to a string during rendering, but the converter returns null (there's only one converter attached to the chain, a NoSelectionConverter, which returns NO_SELECTION_VALUE, so the chain returns null).
It looks like the there is normally a default converter to fall back on. I think the ConverterChain constructor tries to create a default converter based on the type of the value, but this doesn't work for Strings (debugging showed that facesContext.getApplication().createConverter(String.class) returns null).
So, I think the solution would be to have the ConverterChain constructor create a default pass-through String converter when valueBinding.getType(facesContext) is equal to String.class.
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4043977#4043977
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4043977
19 years