wood burning stoves*
The moose likes JSF and the fly likes recursive JSF action Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


JavaRanch » Java Forums » Java » JSF
Bookmark "recursive JSF action" Watch "recursive JSF action" New topic
Author

recursive JSF action

sriram vemaraju
Greenhorn

Joined: Feb 11, 2008
Posts: 16
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

Joined: Oct 08, 2006
Posts: 2458
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

Joined: Jun 25, 2001
Posts: 16094
    
  21

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.


Customer surveys are for companies who didn't pay proper attention to begin with.
sriram vemaraju
Greenhorn

Joined: Feb 11, 2008
Posts: 16
Thanks a lot i wanted to try but thought that it would hang up my system.
Tim Holloway
Saloon Keeper

Joined: Jun 25, 2001
Posts: 16094
    
  21

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.
 
It is sorta covered in the JavaRanch Style Guide.
 
subject: recursive JSF action