You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@struts.apache.org by Alceu Medeiros <al...@gmail.com> on 2008/01/22 15:10:26 UTC

Problems registering pojo

Hi,

I'm beginner and I'm trying to make a basic CRUD app following this
tutorial:
http://cwiki.apache.org/S2WIKI/struts-2-spring-2-jpa-ajax.html

In this example, I'm trying to do something similar to the Person's save()
function, but when I submit a form my pojo in Action class isn't populated,
it's coming with null value. To populate 'person.firstName', for example,
Struts 2 should call getPerson() and then the setFirstName() function, but
getPerson() is coming with null value. I'm getting this message:

- - -
type Exception report

message

description The server encountered an internal error () that prevented it
from fulfilling this request.

exception

javax.servlet.ServletException: attempt to create create event with null
entity
    org.apache.struts2.dispatcher.Dispatcher.serviceAction(Dispatcher.java
:515)
    org.apache.struts2.dispatcher.FilterDispatcher.doFilter(
FilterDispatcher.java:419)

(...)

- - -

A friend mine said something about setting the "paramsprepareparams" to my
action's configuration, but it's already extending "struts-default" package.
Shouldn't Struts 2 populate my pojo setting a "new Person()"? Is there
anybody who can help me with something?

[]'s

-- 
"Realize buscando o melhor, mas planeje esperando o pior."
______________________________
Alceu Medeiros
http://www.inf.ufsc.br/~alceu

Re: Problems registering pojo

Posted by José Cervera <jo...@gmail.com>.
Hard to say without seeing some code... Try to change the given example step
by step, approaching your final result, until you find the relevant
difference. Do you have an empty constructor for your bean?

Regards.

On Jan 22, 2008 3:10 PM, Alceu Medeiros <al...@gmail.com> wrote:

> Hi,
>
> I'm beginner and I'm trying to make a basic CRUD app following this
> tutorial:
> http://cwiki.apache.org/S2WIKI/struts-2-spring-2-jpa-ajax.html
> [...]



>
> javax.servlet.ServletException: attempt to create create event with null
> entity
>    org.apache.struts2.dispatcher.Dispatcher.serviceAction(Dispatcher.java
> :515)
>    org.apache.struts2.dispatcher.FilterDispatcher.doFilter(
> FilterDispatcher.java:419)
>
>