Turns into this code in the _jspService() method
[Ref: HFSJ, Page #- 350]
It means if it doesn't find person object then and only then it will create new one. Now my case,
If I don't write no-arg constructor I get
The value for the useBean class attribute com.company.testservlet.command.Dog is invalid error.
But in my servlet I do set dog object in request parameter. Then why does it give me error? :evil:
Bauke Scholtz wrote:Every javabean is expected to have a default no-arg constructor.
yeah that's what the conclusion. and I also searched on internet and all over the solution is to include public no-arg constructor.But I am confused after seeing its conversion to servlet. It doesn't actually create an instance if it finds one in the given scope. Then why do I get this error? :twisted: