اكثر اسئلة واجوبة المقابلات طلبا والاختبارات عبر الإنترنت
منصة تعليمية للتحضير للمقابلات والاختبارات عبر الإنترنت والدروس والتدريب المباشر

طوّر مهاراتك من خلال مسارات تعلم مركزة واختبارات تجريبية ومحتوى جاهز للمقابلات.

يجمع WithoutBook أسئلة المقابلات حسب الموضوع والاختبارات العملية عبر الإنترنت والدروس وأدلة المقارنة في مساحة تعلم متجاوبة واحدة.

التحضير للمقابلة

الاختبارات التجريبية

اجعلها الصفحة الرئيسية

احفظ هذه الصفحة في المفضلة

الاشتراك عبر البريد الإلكتروني

JSF اسئلة واجوبة المقابلات

فروقات ذات صلة

فروقات ذات صلة

JSF vs JSPJSF 1.2 vs JSF 2.0JSF 2.0 vs JSF 2.1
Struts vs JSF

سؤال 16. How to terminate the session?

In order to terminate the session you can use session invalidate method.

This is an example how to terminate the session from the action method of a backing bean:

public String logout() {
FacesContext fc = FacesContext.getCurrentInstance();
HttpSession session = (HttpSession) fc.getExternalContext().getSession(false);
session.invalidate();
return "login_page";
}
The following code snippet allows to terminate the session from the jsp page:

<% session.invalidate(); %>

هل هذا مفيد؟ اضف تعليقا عرض التعليقات
 

سؤال 17. How to reload the page after ValueChangeListener is invoked?

At the end of the ValueChangeListener, call FacesContext.getCurrentInstance().renderResponse()

هل هذا مفيد؟ اضف تعليقا عرض التعليقات
 

سؤال 18. How to download PDF file with JSF?

This is an code example how it can be done with action listener of the backing bean.

Add the following method to the backing bean:


public void viewPdf(ActionEvent event) {
String filename = "filename.pdf";

// use your own method that reads file to the byte array
byte[] pdf = getTheContentOfTheFile(filename);

FacesContext faces = FacesContext.getCurrentInstance();
HttpServletResponse response = (HttpServletResponse) faces.getExternalContext().getResponse();

response.setContentType("application/pdf");
response.setContentLength(pdf.length);
response.setHeader( "Content-disposition", "inline; filename=""+fileName+""");
try {
ServletOutputStream out;
out = response.getOutputStream();
out.write(pdf);
} catch (IOException e) {
e.printStackTrace();
}
faces.responseComplete();
}
This is a jsp file snippet:

<h:commandButton immediate="true" actionListener="#{backingBean.viewPdf}" value="Read PDF" />

هل هذا مفيد؟ اضف تعليقا عرض التعليقات
 

سؤال 19. How to show Confirmation Dialog when user Click the Command Link?

ah:commandLink assign the onclick attribute for internal use. So, you cannot use it to write your own code. This problem will fixed in the JSF 1.2. For the current JSF version you can use onmousedown event that occurs before onclick.
<script language="javascript">
function ConfirmDelete(link) {
var delete = confirm('Do you want to Delete?');
if (delete == true) {
link.onclick();
}
}
</script>

. . . . <h:commandLink action="delete" onmousedown="return ConfirmDelete(this);">
<h:outputText value="delete it"/> </h:commandLink>

هل هذا مفيد؟ اضف تعليقا عرض التعليقات
 

سؤال 20. What is the different between getRequestParameterMap() and getRequestParameterValuesMap()

getRequestParameterValuesMap() similar to getRequestParameterMap(), but contains multiple values for for the parameters with the same name. It is important if you one of the components such as <h:selectMany>.

هل هذا مفيد؟ اضف تعليقا عرض التعليقات
 

الاكثر فائدة حسب تقييم المستخدمين:

حقوق النشر © 2026، WithoutBook.