Home | JSP | EJB | JDBC | Java Servlets | WAP  | Free JSP Hosting  | Spring Framework | Web Services | BioInformatics | Java Server Faces | Jboss 3.0 tutorial | Hibernate 3.0 | XML
 
 
Hot Web Programming Job

 

Tutorial Categories: Ajax | Articles | JSP | Bioinformatics | Database | Free Books | Hibernate | J2EE | J2ME | Java | JavaScript | JDBC | JMS | Linux | MS Technology | PHP | RMI | Web-Services | Servlets | Struts | UML


 

Java Tutorials

Core Java
JSP
Servlet
JDBC
Hibernate
Struts 1
Struts 2
JSF
Spring
J2EE
J2ME
Web Services
Ajax
Dojo
MySQL
Latest Comments
hi
data not getting i
Nice
Movie Theatre Tick
JAVA
  All Comments...
 

 

 
Struts Tutorials
*Stuts TOC
*Apache Struts Introduction
* Struts Controller
* Struts Action Class
* Struts ActionFrom Class
* Using Struts HTML Tags
*Struts Validator Framework    
*Client Side Address Validation    
*Struts Tiles
*tiles-defs.xml
*Struts DynaActionForm
*Struts File Upload
*Struts DataSource
*AGGREGATING ACTIONS
*Internationalization
Struts Resources
*Struts Books
*Struts Articles
*Struts Frameworks
*Struts IDE
*Struts Alternative
*Struts Links
*Struts Presentations
*Struts Projects
*Struts Software
*Struts Reference
*Struts Resources
*Other Struts Tutorial
Visit Forum! Post Questions!
Jobs At RoseIndia.net!

Have tutorials?
Add your tutorial to our Java Resource and get tons of hits.

We offer free hosting for your tutorials. and exposure for thousands of readers. drop a mail
roseindia_net@yahoo.com
 
   

 
Join For Newsletter

Powered by groups.yahoo.com
Visit Group! Post Questions!

JSF Interview Questions

                          

  1. How can we replace the JSF Standard Error Message?
    Create the message bundle file and set the value of the key for a particular type of error specified in JSF specification.
    For example, JSF specification supplies value "Value is required" for key "javax.faces.component.UIInput.REQUIRED" so replace the value in our message bundle file similar to the following :

     


    javax.faces.component.UIInput.REQUIRED= Please enter the required value.

    Register the message bundle within <application> tag  in the configuration file (faces-config.xml) and restart the server. Now when we use message or messages tag in the view page then the value specified in this message bundle file for a particular error is displayed.
      

  2. How we can change the appearance of error messages in a JSF Page?
    The appearance can be changed by any of the two methods :
    Using "style" attribute or "styleClass" attribute. "style" attribute is used to set the CSS style definition for the component while styleClass attribute is used to set the CSS class for the component. Using "styleClass" attribute is same as html "class" attribute.
  3. What is the significance of properties file (Resource Bundle) and how to use this in our JSF page?
    Properties file is a collection of param=value pairs. This provides a great benefit to the application like we can modify these values easily and there is no need to change the JSP file. For example, we can create "message.properties" like :
    prompt=Enter Your Name:
    greeting_text=Welcome In Roseindia
    button_text=Submit

    Now edit the configuration file using <message-bundle> element which tells the application where the message resource file is located.

    <application>
     <message-bundle>roseindia.messages</message-bundle>
    </application>

    Now, message resource bundle is loaded first using core tag <f:loadBundle> in view page. That loads the bundle and stores it in the request scope. 

    <f:loadBundle basename="roseindia.messages" var="message"/>

    We can now use this in our JSP like below :

    <h:outputText value="#{message.prompt}"/>
  4.  
  5. How can I use several configuration resource files in one single application?
    JSF finds configuration file or files looking in context initialization parameter, javax.faces.CONFIG_FILES  in web.xml, that specifies one or more paths to multiple configuration files for your web application. These multiple paths must be comma separeted. The important point to remember is not to register /WEB-INF/faces-config.xml file in the web.xml. Otherwise, the JSF implementation will process it twice. For example, make changes in web.xml like below :
    <context-param>
    <param-name>javax.faces.CONFIG_FILES</param-name>
    <param-value>
    /WEB-INF/test1-config.xml,/WEB-INF/test2-config.xml
    </param-value>
    </context-param>
     
  6. Can we use a different configuration resource file in place of traditional "faces-config.xml" file in our application?
    JavaServer Faces technology provides an XML document for configuring resources. This file is used to register application's resources, such as validators, converters, managed beans, and navigation rules. This application configuration resource file is usually called faces-config.xml. You can have more than one application configuration resource file but it must be valid against the DTD located at http://java.sun.com/dtd/web-facesconfig_1_0.dtd. Now register the file within context-param element in web.xml file.

                          

Facing Programming Problem?
Add This Tutorial To:
  Del.icio.us   Digg   Google   Spurl   Blink   Furl   Simpy   Y! MyWeb 

Current Comments

0 comments so far (post your own) View All Comments Latest 10 Comments:

Leave your comment:

Name:

Email:

URL:

Title:

Comments:


Enter Code:

 

Note: Emails will not be visible or used in any way, and are not required. Please keep comments relevant. Any content deemed inappropriate or offensive may be edited and/or deleted.

No HTML code is allowed. Line breaks will be converted automatically. URLs will be auto-linked. Please use BBCode to format your text.

  JDO Tutorials
  EAI Articles
  Struts Tutorials
  Java Tutorials
  Java Certification

Tell A Friend
Your Friend Name
Search Tutorials

 

 
 
Browse all Java Tutorials
Java JSP Struts Servlets Hibernate XML
Ajax JDBC EJB MySQL JavaScript JSF
Maven2 Tutorial JEE5 Tutorial Java Threading Tutorial Photoshop Tutorials Linux Technology
Technology Revolutions Eclipse Spring Tutorial Bioinformatics Tutorials Tools SQL
 

Home | JSP | EJB | JDBC | Java Servlets | WAP  | Free JSP Hosting  | Search Engine | News Archive | Jboss 3.0 tutorial | Free Linux CD's | Forum | Blogs

About Us | Advertising On RoseIndia.net  | Site Map

India News

Send your comments, Suggestions or Queries regarding this site at roseindia_net@yahoo.com.

Copyright © 2007. All rights reserved.