File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
The moose likes JSF and the fly likes How to run Controller method when page loads ? Big Moose Saloon
  Search | Java FAQ | Recent Topics
Register / Login
JavaRanch » Java Forums » Java » JSF
Reply Bookmark "How to run Controller method when page loads ?" Watch "How to run Controller method when page loads ?" New topic
Author

How to run Controller method when page loads ?

Daniel Breitner
Ranch Hand

Joined: Nov 13, 2008
Posts: 70
Hello

I have a JSF page on which i�d like to call a specific Controller method (config) everytime the page loads.

I tried to do it with an hidden input field but then other methods were executed before my config- method.

How do I tell the page to load a method as the first method on that page ?


Visit me at http://liferay-blogging.blogspot.com
Bob Good
Ranch Hand

Joined: Jan 09, 2008
Posts: 86
In Rational Application Developer, you can invoke a method using:
Himanshu Gupta
Ranch Hand

Joined: Aug 18, 2008
Posts: 598

Its a known problem. You can write the code in constructor if your bean is in request scope. If it is in session or application then make use of some getter.

If you find anything better then please let us also know that.


My Blog SCJP 5 SCWCD 5
 
I agree. Here's the link: http://ej-technologies/jprofiler - if it wasn't for jprofiler, we would need to run our stuff on 16 servers instead of 3.
 
subject: How to run Controller method when page loads ?
 
Similar Threads
"STRUTS-like action"
JSP calls Servlet calls JSP
how to increment a variable value in javascript on page loads
why controller is servlet
Controller in MVC architecture