• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

recursive JSF action

 
sriram vemaraju
Greenhorn
Posts: 16
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
What is the error we get when we call a JSF action recursively?

Code:
Public String actionOpen()
{
String Str="";
return actionOpen();
}

I think its a stackoverflow exception ..??
 
Bauke Scholtz
Ranch Hand
Posts: 2458
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Try it yourself?

It is not different from how it behave in plain vanilla Java (which the posted code actually is, JSF is just a component based MVC framework).
 
Tim Holloway
Saloon Keeper
Posts: 18304
56
Android Eclipse IDE Linux
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Yup.

An action processor is jkust a plain old method, and it does exactly what any other plain old method would do. The only thing magic about Action methods is that JSF calls them when a view demands it.
 
sriram vemaraju
Greenhorn
Posts: 16
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thanks a lot i wanted to try but thought that it would hang up my system.
 
Tim Holloway
Saloon Keeper
Posts: 18304
56
Android Eclipse IDE Linux
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
sriram vemaraju wrote:Thanks a lot i wanted to try but thought that it would hang up my system.


Only temporarily. Eventually the thread would blow on a stack overflow.

How "hung up" your system would be can vary. Other threads will continue to run, but the CPU running the recursing thread would go to 100%, and overall system response will be degraded. It shouldn't crash or lock the machine, however.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic