File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

JSF + AJAX partial rendering redundent method call

 
Dziki Dzik
Greenhorn
Posts: 2
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi All!

I am aware that JSF may call a managed bean method a couple of times even if it is called only once in .xhtml.
I understand that is due to JSF lifecycle phases.

I would like to ask you to explain the following case to me.
I have a JSF file that sort of looks like this:

<h:form id="form1">
<h:panelGroup id="output"/>
...
<h:commandLink...
<f:ajax render=":form1: output"/>
...
</h:commandLink>
</h:form>

All clear so far; pressing the command link rerenders a part of the page within the form panelGroup.
The code follows:

...
<ui:repeat value="#{movieBean.categories}" var="category">
<li>
<h: outputLink value="index.xhtml">
<f:param name="categoryId" value="#{category.categoryId}"/>
<h: outputText value="#{category.description}"/>
</h: outputLink>
</li>
</ui:repeat>
#{movieBean.categories} //this is just a 'test line'

movieBean is request scoped.

Now, when I enter the page for the first time I get two calls to movieBean.categories.
That is clear because it is called twice in the code. However, when I hit the AJAX link rendering
only a part of the page (output) I get movieBean.categories from <ui:repeat> called again even
though it is outside the partially rendered page area. The 'test line' is not called this time.

I performed another test. I deleted the <ui:repeat> tag leaving the 'test line' only.
AJAX partial rendering dosen't call it as before.

What makes the movieBean.categories call inside a <ui:repeat> tag different
than the one in 'test line'? And why is the call inside <ui:repeat> made when pressing the AJAX link
even though it is outside partially rendered <h:panelGroup id="output"/> tag?
 
Dziki Dzik
Greenhorn
Posts: 2
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I am aware that JSF may call a managed bean method a couple of times even if it is called only once in .xhtml. I understand that is due to JSF lifecycle phases.

A small correction. I'm not sure if what I wrote here about lifecycle phases is true. It is true, however, that some evaluation in UIComponents and Resolver .encode* methods causes multiple managed bean method calls.
 
mallareddy gamannagari
Greenhorn
Posts: 3
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
hi all,
here, i want to use JEE container based security for my application. Here i have configured realm in tomcat and in my application and validating user and role succeeded but the problem is i'm not getting how to redirect to my home page after completion of j_security_check

in my page i'm getting fallowing error
in url:::::::::http://localhost:9999/HMS/j_security_check
in webpage:::::::
HTTP Status 408 - The time allowed for the login process has been exceeded. If you wish to continue you must either click back twice and re-click the link you requested or close and re-open your browser


please helm me anyone
thanks to advance all...... :rolleyes
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic