You really should take a look at some of the examples and read the reference. I found it
*extremely* useful to use SeamGen to start with. Gives you something that works right
away.
For starters, you need something to provide a list of zipcodes. In your page you
have:<s:selectItems value="#{zipCodes.resultList}" var="zip"
label="#{zip.zipcodeNumber}" />
But zipCodes is an entity and has no method called getResultList() or resultList(). You
have 2 easy options:
1. Add an entityQuery to your components.xml<framework:entity-query
name="zipCodeList"
| ejbql="select z from ZipCodes z"/>
2. Create a Bean that builds the list:
| @Name("zipCodeList")
| public class ZipCodeList() {
| @In(create=true)
| EntityManager entityManager; //actually you need to add this to your components.xml as
well!
|
| public List<ZipCodes> getResultList() {
| return entityManager.createQuery("select z from ZipCodes
z").getResultList();
| }
| }
And then your page should have:
<s:selectItems value="#{zipCodeList.resultList}" var="zip"
label="#{zip.zipcodeNumber}" />
Don't forget to add an entityManager to your components.xml:
<persistence:managed-persistence-context name="entityManager"
| auto-create="true"
| persistence-unit-jndi-name="java:/OracleDS"/>
Have a play with that. There are a few other things you need to fix up as well but you
should find them.
Cheers,
Damian.
View the original post :
http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4096440#...
Reply to the post :
http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&a...