I have a jsf page which includes an inputText and a button.
I would call a servlet at the click of the button, display the value of the InputText filled , and redisplay the same jsf page with inputText filled.
The fields of my jsf page
My function that calls the servlet in the managed bean
And my servlet
The problem is that once we get to the servlet, the redirection to the jsf page does not work, I have a stackoverflow error:
at dispatcher.forward(request, response) method
"forward" doesn't mean "call". When you call something, it returns to you. When you forward, it doesn't return.
If the servlet is located internal to the same webapp as JSF, "calling" the servlet is probably a bad idea. If there is code in the servlet that JSF code needs, it's usually cleaner to have JSF call the code directly via ordinary Java method calls. Ideally, the shared code will be in a distinct shareable business logic bean rather than in the servlet class itself.
JSF and traditional servlets/JSPs can happily reside side-by-side, and they can pass data between each other via session and application-scope beans.
An IDE is no substitute for an Intelligent Developer.
Joined: Sep 17, 2010
Thank you for your help
Finally, I decided to go through the couple JSP / Servlet thanks to a form and it works well