Good day to all.
I have a Stripes app I’m writing that has two EJB3 entities, a TodoList and
a TodoItem.
A list of TodoItems usually is part of a TodoList.
My initial page is a list of all TodoLists.  When you click on the
description of a list, it brings 
up a JSP page showing the list fields, and a table of TodoItems that belong
to that list.
But, when I click on one of the items (its description), I get an error:
13:20:19,401 INFO  [TodoItemActionBean] preEditItem: Item ID = (null)
13:20:19,401 INFO  [STDOUT] *** TracingInterceptor intercepting
13:20:19,401 WARN  [TodoServiceBean] findTodoItem(null):0:threw
java.lang.IllegalArgumentException: id to load is required for loading
13:20:19,401 INFO  [STDOUT] *** TracingInterceptor invocation of
org.jboss.ejb3.interceptor.InvocationContextImpl.findTodoItem() took 0ms
13:20:19,401 WARN  [DefaultExceptionHandler] Unhandled exception caught by
the Stripes default exception handler.
javax.ejb.EJBException: java.lang.IllegalArgumentException: id to load is
required for loading
        at
org.jboss.ejb3.tx.Ejb3TxPolicy.handleExceptionInOurTx(Ejb3TxPolicy.java:63)
        at org.jboss.aspects.tx.TxPolicy.invokeInOurTx(TxPolicy.java:83)
        at
org.jboss.aspects.tx.TxInterceptor$Required.invoke(TxInterceptor.java:191)
        ….more….
Caused by: java.lang.IllegalArgumentException: id to load is required for
loading
        at org.hibernate.event.LoadEvent.<init>(LoadEvent.java:51)
        at org.hibernate.event.LoadEvent.<init>(LoadEvent.java:33)
        ….more….
13:20:19,416 ERROR [ContainerBase] Servlet.service() for servlet
StripesDispatcher threw exception
java.lang.IllegalArgumentException: id to load is required for loading
        at org.hibernate.event.LoadEvent.<init>(LoadEvent.java:51)
        at org.hibernate.event.LoadEvent.<init>(LoadEvent.java:33)
        at org.hibernate.impl.SessionImpl.get(SessionImpl.java:812)
        ….more….
The stripes:link tag for the initial page (to get to the list display page)
is:
[Code}
                <stripes:link
beanclass="edu.msu.ais.sampleapp.todosample.web.action.TodoListActionBean" 
                                event="preEdit">
                        <stripes:param name="todoList.todoListID"
value="${todoList.todoListID}"/>
                                ${todolist.todoName}
                </stripes:link>
[/Code]
The link tag for the list page (to get to the item display page) is:
[Code]
                <stripes:link
beanclass="edu.msu.ais.sampleapp.todosample.web.action.TodoItemActionBean" 
                                event="preEdit">
                        <stripes:param name="todoitem.todoItemID"
value="${todoitem.todoItemID}"/>
                                ${todoitem.description}
                </stripes:link>
[/Code]
The ‘preEdit’ method in each action bean simply reads the list or item whose
ID is passed by the stripes:param, 
populating the list or item object.  I should mention that I have the list
and item objects defined in a TodoBaseActionBean 
that acts as a superclass for the two action beans above, TodoListActionBean
and TodoItemActionBean.  I don’t believe 
this should be a factor, but I’ve been known to be wrong on occasion.
If you need more code, I can sent a jar or zip file with code thru email, or
post relevant items with another post.

Thanks…..

Thomas J. Clifford
Technical Services Developer
Admistrative Information Services (AIS)
2 Admin Building
Michigan State University
517.353.4420 x265
[email protected]

-- 
View this message in context: 
http://www.nabble.com/Odd-behavior-for-stripes%3Alink%2C-two-level-jsp-pages---entities-tp23621306p23621306.html
Sent from the stripes-users mailing list archive at Nabble.com.


------------------------------------------------------------------------------
Crystal Reports - New Free Runtime and 30 Day Trial
Check out the new simplified licensing option that enables 
unlimited royalty-free distribution of the report engine 
for externally facing server and web deployment. 
http://p.sf.net/sfu/businessobjects
_______________________________________________
Stripes-users mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/stripes-users

Reply via email to