>> Friday, June 17, 2011
Q).How you can add the Global exception in your configuration file?
A).The <global-exception> sub-element is used to define n-number of <exception> sub-elements that are throwable by any Action in a Struts application. This sub-element acts as a container for all public <exception> sub-element.
The <exception sub-element> is used to associate a global exception with an ExceptionHandler.
The following declaration in struts-config.xml:
<global-exceptions>
<exception
key="qams.exception"
type="java.lang.Exception"
handler="com.qas.exceptions.QAMSExceptionHandler"/>
</global-exceptions>
Q).What is for <html:base/> tag in the HTML tag library defined in the Struts.
A).The <html:base/> tag is used to insert an HTML <base> element, including an href pointing to the absolute location of the hosting JSP page. This tag allows you to use relative URL references, rather than a URL that is relative to the most recent requested resource. The <html:base/> tag has no body and supports two attributes:
* target : Represents the target attribute of the HTML <base> tag (optional)
* server : Identifies a server name to use in the href as opposed to the result of a call to request.getServerName() (optional).
Q).What is for <html:cancel/> tag in HTML tag library in the Struts framework?
A).The <html:cancel /> tag is used to render an HTML <input> element with an input type of cancel. The <html:cancel /> has a body type of JSP and support the 25 attributes:
accessKey, alt, altKey, disabled, onblur, onchange, onclick, ondblclick, onfocus, onkeydown, onkeypress, onkeyup, onmousedown, onmousemove, onmouseout, onmouseover, onmouseup, property, style, styleClass, styleId, tabindex, title, titleKey, value.
Q).What is for <html:checkbox /> tag in HTML tag library in the Struts framework?
A).The <html:checkbox/> tag is used to render an HTML <input> element with an input type of checkbox. The <html:checkbox/> has a body type of JSP and supports 27 attribute:
indexed, name, accessKey, alt, altKey, disabled, onblur, onchange, onclick, ondblclick, onfocus, onkeydown, onkeypress, onkeyup, onmousedown, onmousemove, onmouseout, onmouseover, onmouseup, property, style, styleClass, styleId, tabindex, title, titleKey, value.
Q).what is for <html:errors> tag in the HTML tag library? Define its attributes?
A).The <html:errors /> tag is used to display the ActionError objects stored in an ActionErrors collection. The <html:errors /> tag has a body type of JSP and support four attributes:
* bundle : Specifies a MessageResources key of the resource bundle defined in the struts-config <message-resource> element.
* locale : Specifies the session attribute containing the locale instance of the current. This locale is then used to select Locale-specific text messages.
* name : Specifies the name of the request scope object that references the ActionErrors collection being displayed.
* property : Specifies which error message should be displayed, based on each property contained in the ActionErrors collection.
Q).what is the use of <html:file/> tag? Name all the attributes of this tag?
A).The <html:file/> tag is used to create an HTML <file> element. This tag allows you to upload files that will be populated in named ActionForm\'s identified property. The <html:file/> tag has a body of JSP and supports 30 attributes:
indexed, name, accessKey, alt, altKey, disabled, onblur, onchange, onclick, ondblclick, onfocus, onkeydown, onkeypress, onkeyup, onmousedown, onmousemove, onmouseout, onmouseover, onmouseup, property, style, styleClass, styleId, tabindex, title, titleKey, value, accept, maxlength, size.
Q).what is the use of <html:form/> tag? Name all the attributes of this tag?
A).The <html:form/> tag is used to create an HTML form. The form implicitly interacts with the named ActionForm bean to pre-populate the input fields values with the matching data members of the named bean. The <html:form/> tag has a body type of JSP and supports 13 attributes:
action, enctype, focus, focusIndex, method, onreset, onsubmit, scope, style, styleClass, styleId, target, type.
Q).What is the difference between <html:image/> and <html:img/> tag in the HTML tag library in struts framework?
A).The <html:image/> tag is used to render an HTML <input> element with an input type of image. The image URL generated for this image is calculated using the value identified by the src or page attributes. You must specify one of the src or page attributes. The <html:image/> has a body type of JSP.
The <html:img/> tag is used to render an HTML <img> element. The image URL generated for this image is calculated using the value identified by the src or page attributes. You must specify one of the src or page attributes. The <html:img/> has no body.
Q).What is the use of <html:javascript/> tag in the HTML tag library?
A).The <html:javascript/> tag is used to insert JavaScript validation methods based on the Commons Validator Plugin. The JavaScript methods used for validation are retrieved from the validator definition file using the formName as the index. The <html:javascript/> tag has no body and supports eight attributes:
cdata, dynamicJavaScript, formName, htmlComment, method, page, src, staticJavascript.
Q).What is the use of <html:message/> tag in HTML tag library used in Struts application?
A).The <html:message/> tag is used to display a collection of messages stored in an ActionErrors, ActionMessages, String, or String array object. The <html:message/> has a body type of JSP and supports eight attributes:
id, bundle, locale, name, property, header, footer, message.
Q).What is for <html:rewrite/> tag used defined by the HTML tag library?
A).The <html:rewrite/> tag is used to create a request URI based on the identical policies used with the <html:link/> tag but without the <a> element. The <html:rewrite/> tag has no body and supports 12 attributes:
anchor, forward, href, name, page, paramId, paramName, paramProperty, paramScope, property, scope, transaction.
A).The <global-exception> sub-element is used to define n-number of <exception> sub-elements that are throwable by any Action in a Struts application. This sub-element acts as a container for all public <exception> sub-element.
The <exception sub-element> is used to associate a global exception with an ExceptionHandler.
The following declaration in struts-config.xml:
<global-exceptions>
<exception
key="qams.exception"
type="java.lang.Exception"
handler="com.qas.exceptions.QAMSExceptionHandler"/>
</global-exceptions>
Q).What is for <html:base/> tag in the HTML tag library defined in the Struts.
A).The <html:base/> tag is used to insert an HTML <base> element, including an href pointing to the absolute location of the hosting JSP page. This tag allows you to use relative URL references, rather than a URL that is relative to the most recent requested resource. The <html:base/> tag has no body and supports two attributes:
* target : Represents the target attribute of the HTML <base> tag (optional)
* server : Identifies a server name to use in the href as opposed to the result of a call to request.getServerName() (optional).
Q).What is for <html:cancel/> tag in HTML tag library in the Struts framework?
A).The <html:cancel /> tag is used to render an HTML <input> element with an input type of cancel. The <html:cancel /> has a body type of JSP and support the 25 attributes:
accessKey, alt, altKey, disabled, onblur, onchange, onclick, ondblclick, onfocus, onkeydown, onkeypress, onkeyup, onmousedown, onmousemove, onmouseout, onmouseover, onmouseup, property, style, styleClass, styleId, tabindex, title, titleKey, value.
Q).What is for <html:checkbox /> tag in HTML tag library in the Struts framework?
A).The <html:checkbox/> tag is used to render an HTML <input> element with an input type of checkbox. The <html:checkbox/> has a body type of JSP and supports 27 attribute:
indexed, name, accessKey, alt, altKey, disabled, onblur, onchange, onclick, ondblclick, onfocus, onkeydown, onkeypress, onkeyup, onmousedown, onmousemove, onmouseout, onmouseover, onmouseup, property, style, styleClass, styleId, tabindex, title, titleKey, value.
Q).what is for <html:errors> tag in the HTML tag library? Define its attributes?
A).The <html:errors /> tag is used to display the ActionError objects stored in an ActionErrors collection. The <html:errors /> tag has a body type of JSP and support four attributes:
* bundle : Specifies a MessageResources key of the resource bundle defined in the struts-config <message-resource> element.
* locale : Specifies the session attribute containing the locale instance of the current. This locale is then used to select Locale-specific text messages.
* name : Specifies the name of the request scope object that references the ActionErrors collection being displayed.
* property : Specifies which error message should be displayed, based on each property contained in the ActionErrors collection.
Q).what is the use of <html:file/> tag? Name all the attributes of this tag?
A).The <html:file/> tag is used to create an HTML <file> element. This tag allows you to upload files that will be populated in named ActionForm\'s identified property. The <html:file/> tag has a body of JSP and supports 30 attributes:
indexed, name, accessKey, alt, altKey, disabled, onblur, onchange, onclick, ondblclick, onfocus, onkeydown, onkeypress, onkeyup, onmousedown, onmousemove, onmouseout, onmouseover, onmouseup, property, style, styleClass, styleId, tabindex, title, titleKey, value, accept, maxlength, size.
Q).what is the use of <html:form/> tag? Name all the attributes of this tag?
A).The <html:form/> tag is used to create an HTML form. The form implicitly interacts with the named ActionForm bean to pre-populate the input fields values with the matching data members of the named bean. The <html:form/> tag has a body type of JSP and supports 13 attributes:
action, enctype, focus, focusIndex, method, onreset, onsubmit, scope, style, styleClass, styleId, target, type.
Q).What is the difference between <html:image/> and <html:img/> tag in the HTML tag library in struts framework?
A).The <html:image/> tag is used to render an HTML <input> element with an input type of image. The image URL generated for this image is calculated using the value identified by the src or page attributes. You must specify one of the src or page attributes. The <html:image/> has a body type of JSP.
The <html:img/> tag is used to render an HTML <img> element. The image URL generated for this image is calculated using the value identified by the src or page attributes. You must specify one of the src or page attributes. The <html:img/> has no body.
Q).What is the use of <html:javascript/> tag in the HTML tag library?
A).The <html:javascript/> tag is used to insert JavaScript validation methods based on the Commons Validator Plugin. The JavaScript methods used for validation are retrieved from the validator definition file using the formName as the index. The <html:javascript/> tag has no body and supports eight attributes:
cdata, dynamicJavaScript, formName, htmlComment, method, page, src, staticJavascript.
Q).What is the use of <html:message/> tag in HTML tag library used in Struts application?
A).The <html:message/> tag is used to display a collection of messages stored in an ActionErrors, ActionMessages, String, or String array object. The <html:message/> has a body type of JSP and supports eight attributes:
id, bundle, locale, name, property, header, footer, message.
Q).What is for <html:rewrite/> tag used defined by the HTML tag library?
A).The <html:rewrite/> tag is used to create a request URI based on the identical policies used with the <html:link/> tag but without the <a> element. The <html:rewrite/> tag has no body and supports 12 attributes:
anchor, forward, href, name, page, paramId, paramName, paramProperty, paramScope, property, scope, transaction.
0 comments:
Post a Comment