During working with JSF 1.2 one page code is too large and JDeveloper gave too large code in service method exception. Now I want to split my JSF file in smaller files. During splitting I need some help and suggestion.
Beacuse the whole page binds with a single bean, is it also necessary to split the bean? If not, then how to overcome this? What is the best way to split JSF file and include in main page?
You don’t need to split the bean. You could just split the page fragments over multiple files which you include by
<jsp:include>(and not by@includeas that happens during compiletime and you would end up with still the same exception!). Note that you should store those include files in/WEB-INFfolder to prevent direct access by enduser.So given this example of an “extremely large” page,
You could split it as follows while keeping the beans:
and
/WEB-INF/includes/include1.jsp:and
/WEB-INF/includes/include2.jsp:and
/WEB-INF/includes/include3.jsp: