Hi.

 

I'm trying to create a delete button for each row then set a request
parameter with the current "person".

The bold lines are the lines of code I added to the example:

 

<c:forEach var="person" begin="0" items="${requestScope.personList}">

    <tr>

        <form id="personForm" action="DeletePerson" method="post">

            <td>${person.id}&nbsp;&nbsp;</td>

            <td>${person.firstName}&nbsp;&nbsp;</td>

            <td>${person.lastName}&nbsp;&nbsp;</td>

            <th><input type="submit" value="DeletePerson"
name="DeletePerson">

                    <c:set var="delete_person" scope="request"
value="${person}"/>

                </input>

            </th>

        </form>

    </tr> 

</c:forEach>

 

This reaches my DeletePersonServlet, which is almost identical to the
CreatePersonServlet, except that I try to extract the person from the
request like this:

 

Person person = (Person) request.getAttribute("delete_person");

 

And then further down instead of persisting the object I try to remove it:

 

em.remove(person);

 

This is where I get:

 

javax.servlet.ServletException: java.lang.IllegalArgumentException: Object:
null is not a known entity type.

 

In other words my parameter is not being set by my above code in red.

 

I am baffled by this homework. Any help would be greatly appreciated.

 

Thanks,

 

Cj .

 

-----Original Message-----
From: java-ee-j2ee-programming-with-passion@googlegroups.com
[mailto:java-ee-j2ee-programming-with-pass...@googlegroups.com] On Behalf Of
zoso967
Sent: Monday, January 26, 2009 7:49 PM
To: Java EE (J2EE) Programming with Passion!
Cc: zoso...@nyc.rr.com
Subject: [java ee programming] Java Persistence API (JPA) Basics homework

 

 

 

Hello group.

 

I am having trouble with the Java Persistence API (JPA) Basics

homework.

 

The homework says:

 

For each entry (user) being displayed, provide a "Delete" option

 

The only example of this was in the CDLibrary project but that was a

full blown JSF application and the majority of the work was done by

the IDE.

 

The source for our homework project is not a JSF application and the

example uses JSF to do the deletes.

 

Are we supposed to make our homework a JSF application or are we just

supposed to use JSTL?

In either case, I am having trouble. I seem to have trouble with most

of the UI homeworks.

 

Can anyone point me in the right direction?

 

Thanks,

 

Cj .

 



--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups "Java 
EE (J2EE) Programming with Passion!" group.
To post to this group, send email to 
java-ee-j2ee-programming-with-passion@googlegroups.com
To unsubscribe from this group, send email to 
java-ee-j2ee-programming-with-passion+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/java-ee-j2ee-programming-with-passion?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to