Computer Knowledge
Markup and Web Languages
1,492 Questions
Test your understanding of HTML tags, XML structures, and web page creation technologies. The questions cover elements like CSS styling, parsing documents, and defining web attributes. This section is essential for candidates appearing for computer proficiency tests in various competitive exams.
HTML tags and attributesXML document parsingCSS styling levelsWeb page creation basicsBrowser compatibility
Markup and Web Languages Questions
-
It's valid navigation rule
-
It will generate RuntimeException due to lack of <from-outcome> tag
-
page.jsp will never be displayed with this navigation rule
-
It's not proper (although it's valid) navigation-rule. It should have <from-outcome> tag
A,D
Correct answer
Explanation
The claimed answers are A and D. This navigation rule is technically valid XML (A is true), but it's incomplete because a navigation case should have a tag to specify when this navigation should occur (D is true). Option B is incorrect because it won't throw RuntimeException - it's syntactically valid. Option C is incorrect because page.jsp could be displayed as a default view or through other means.
A
Correct answer
Explanation
In JSF, if `is omitted from a navigation rule, it defaults to wildcard matching (*), applying to all views. Therefore, both configurations define a global navigation rule that redirects to/page.jsp` whenever the outcome is 'outcome', making them identical in effect.
-
<name>
-
<icon>
-
<view>
-
<description>
-
<case>
A,C,E
Correct answer
Explanation
The JSF navigation-rule element only accepts specific nested elements: from-view-id, navigation-case, and redirect. The name, icon, view, description, and case elements shown in options are NOT part of the navigation-rule schema. Options A (name), C (view), and E (case) correctly identify invalid elements.
A
Correct answer
Explanation
Both approaches are equivalent. h:outputFormat is a convenience tag that internally uses f:convertDateTime for date formatting. Wrapping f:convertDateTime inside h:outputText achieves the same result, as the converter applies to the outputText value.
A
Correct answer
Explanation
JSF allows multiple validators to be attached to a single component. You can nest multiple f:validator tags or use the validatorIds attribute with Validator interface implementations. All validators execute in sequence during the Process Validations phase.
B
Correct answer
Explanation
Only ONE converter can be attached to a component. Converters are mutually exclusive - applying a second converter replaces the first. This is because a component can only have one single converted value; multiple converters would create ambiguity about which conversion logic to apply.
B
Correct answer
Explanation
The f:view tag has minimal performance overhead. It's required for JSF pages to establish the JSF context and component tree. The overhead is negligible and necessary - avoiding or reducing f:view scope would break JSF functionality, not improve performance.
B
Correct answer
Explanation
This code is invalid. While the taglib declarations and f:view wrapper are correct, h:commandButton must be inside a form element (h:form) to function. Command buttons require form context to handle action events and submission - this code lacks the required h:form wrapper.
A
Correct answer
Explanation
JSON is indeed a text format that is completely language independent. While JSON's syntax was derived from JavaScript, it's supported by virtually every modern programming language through parsers and generators. It was specifically designed to be a universal data interchange format that any language can read and write.
-
Superset of JavaScript
-
Subset of Javascript
-
Not related to Javascript
-
Union of Java and Javascript
B
Correct answer
Explanation
JSON (JavaScript Object Notation) is a lightweight text-based data format that is formally defined as a subset of the JavaScript programming language syntax. It is not a superset, nor is it unrelated to JavaScript, and it has no syntax union with Java.
-
ActionForm
-
Action
-
All of the Above
-
None of the Above
B
Correct answer
Explanation
In Struts 2, HTML form parameters are automatically passed directly to Action classes via parameter interception. The Action class properties match form field names, and Struts 2 populates them automatically. ActionForm (used in Struts 1) is not required in Struts 2.
-
SampleAction-validation.xml
-
SampleClass-validation.xml
-
All Of the above
-
None of the above
B
Correct answer
Explanation
In Struts 2, validation XML files are named after the Action class, not the action name specified in struts.xml. For an action with class SampleClass, the validation file must be named SampleClass-validation.xml. The framework looks for validation files based on the fully qualified class name.
B
Correct answer
Explanation
In Struts 2, the configuration file name 'struts.xml' cannot be changed. The framework hardcodes this name and looks for it in the classpath. This is different from Struts 1, where you could specify a different config file name in web.xml. Struts 2 requires struts.xml to be in a specific location with that exact name.
-
XMLfile1.compare(XMLfile2)
-
XMLcompare(file1,file2)
-
compare(XMLfile1,XMLfile2)
-
compare(file XML1,file XML2)
C
Correct answer
Explanation
In QTP/UFT, the compare() method accepts two XML file objects as parameters and returns their differences. This is the standard syntax for XML comparison within the tool's testing framework.
-
Web System Description Language
-
Web Service Description Language
-
Web Service Definition Language
-
Web System Definition Language
B
Correct answer
Explanation
WSDL (Web Services Description Language) is an XML-based language for describing web services. It defines the service's location, available operations, input/output messages, and data types, enabling clients to understand how to interact with the web service.