0

web technology Online Quiz - 127

Description: web technology Online Quiz - 127
Number of Questions: 20
Created by:
Tags: web technology
Attempted 0/20 Correct 0 Score 0

What is used as a separator in a domain name ?

  1. colon(:)

  2. slash(/)

  3. dot(.)

  4. All the above


Correct Option: C
Explanation:

To solve this question, the user needs to know what a domain name is and its structure.

A domain name is a unique name that identifies a website. It consists of two or more parts separated by dots. The last part is called the top-level domain (TLD), such as .com, .org, .edu, or .net.

Now, let's go through each option and explain why it is right or wrong:

A. All the above: This option is incorrect because it is not specific. While some domain names may use colons or slashes as separators, the most common and widely recognized separator in a domain name is the dot.

B. colon(:): This option is incorrect because colons are not used as separators in domain names. Colons are commonly used in URLs to separate the protocol (e.g., http, https) from the domain name, but they are not part of the domain name itself.

C. slash(/): This option is incorrect because slashes are not used as separators in domain names. Slashes are commonly used in URLs to separate different parts of the path to a resource on a website.

D. dot(.): This option is correct. Dots are used to separate the different parts of a domain name, such as www.example.com. The dot after "com" separates the top-level domain from the rest of the domain name.

Therefore, the correct answer is:

The Answer is: D

which of the below is one of the pega guardrail if flow contains more than 15 shapes

  1. Create a subflow and Use Independent Flows to perform functions

  2. Create a subflow and Use Parallel Flows to perform functions

  3. Use Spilit join shape

  4. Use Spilit for each shape


Correct Option: B

AI Explanation

To answer this question, you need to understand the concept of Pega guardrails and how they apply to flows in Pega.

Guardrails in Pega are a set of best practices and guidelines that ensure the quality and efficiency of application development. They help in maintaining consistency, performance, and scalability of the application.

When it comes to flows in Pega, one of the guardrails is to keep the number of shapes in a flow to a reasonable limit. Having too many shapes in a flow can make it complex and difficult to understand, maintain, and debug. It can also impact the performance of the flow.

Considering this, the correct option from the given choices is:

B. Create a subflow and Use Parallel Flows to perform functions

This option suggests breaking down the flow into smaller subflows and using parallel flows to perform functions. By doing so, you can reduce the number of shapes in the main flow and make it more manageable.

Let's go through the other options as well:

A. Create a subflow and Use Independent Flows to perform functions - This option suggests creating a subflow and using independent flows to perform functions. While this can help in organizing the flow, it does not specifically address the issue of having more than 15 shapes in a flow.

C. Use Split join shape - The split join shape is used to create parallel branches in a flow. While it can help in organizing the flow, it does not specifically address the issue of having more than 15 shapes in a flow.

D. Use Split for each shape - The split for each shape is used to iterate over a collection and perform actions for each item. While it can help in organizing the flow, it does not specifically address the issue of having more than 15 shapes in a flow.

Therefore, the correct answer is B. Create a subflow and Use Parallel Flows to perform functions. This option helps in breaking down the flow into smaller subflows and using parallel flows to perform functions, reducing the number of shapes in the main flow and adhering to the guardrail.

What is happening behind the scenes is that your JSP is being turned into a Java file, compiled and loaded. This compilation only happens once, so after the first load, the file doesn't take long to load anymore.

  1. True

  2. False


Correct Option: A

JSP simply puts Java inside HTML pages. You can take any existing HTML page and change its extension to ".jsp" instead of ".html".

  1. True

  2. False


Correct Option: A

Jsp Page can be excuted from the below, (choose multiple)

  1. Tomcat

  2. Weblogic

  3. Websphere

  4. None of the above


Correct Option: A,B,C

What tools can be used to generate the multiple views in jsp?

  1. xalan-J

  2. Saxon

  3. Jdk1.5

  4. None of the above


Correct Option: A,B

What line of code below might be combined in the same JSP page with a validation guard (for example, ), in order to create an alternate flow of control for scenarios in which exceptions arise. The validationGaurd method might throw an exception, which should cause the flow of control to continue in another user-defined page (assume JSP 1.0).


Correct Option: D

What is the difference between doing an include or a forward with a RequestDispatcher?

  1. The forward method transfers control to the designated resource, while the include method invokes the designated resource, substitutes its output dynamically in the display, and returns control to the calling page.

  2. The two methods provide the same functionality, but with different levels of persistence.

  3. The forward method is deprecated as of JSP 1.1 and the include method should be used in order to substitute portions of a dynamic display at runtime.

  4. The include method transfers control to a dynamic resource, while the forward method allows for dynamic substitution of another JPS pages output, returning control to the calling resource.


Correct Option: A

What is the initial contact point for handling a web request in a Page-Centric architecture?

  1. A JSP page

  2. A JavaBean

  3. A servlet

  4. A session manager


Correct Option: A

AI Explanation

To answer this question, you need to understand the concept of a Page-Centric architecture.

In a Page-Centric architecture, the web request is first handled by a specific page. Each page is responsible for handling a specific request and generating the appropriate response.

Let's go through each option to understand why it is correct or incorrect:

Option A) A JSP page - This option is correct because in a Page-Centric architecture, a JSP (JavaServer Pages) page is often used as the initial contact point for handling a web request. The JSP page contains a mix of HTML and Java code and can be used to generate dynamic content.

Option B) A JavaBean - This option is incorrect. A JavaBean is a reusable software component that follows certain naming conventions. While JavaBeans can be used in a Page-Centric architecture, they are not the initial contact point for handling a web request.

Option C) A servlet - This option is incorrect. A servlet is a Java program that runs on a web server and handles client requests. While servlets can be used in a Page-Centric architecture to handle web requests, they are not the initial contact point.

Option D) A session manager - This option is incorrect. A session manager is responsible for managing user sessions in a web application. While a session manager is an important component of a web application, it is not the initial contact point for handling a web request in a Page-Centric architecture.

The correct answer is A) A JSP page. This option is correct because in a Page-Centric architecture, a JSP page is often used as the initial contact point for handling a web request.

Are custom tags available in JSP 1.0? If not, how else might you implement iteration from within a JSP?

  1. Yes, but the only tags available relate to database access.

  2. No. To iterate over a collection of values, one must use scriptlet code.

  3. No, but there is a standard tag that may be used.

  4. Yes, but custom tags will not help developers create tags for use in iterating over a collection.


Correct Option: B

Choose the statement that best describes how to connect JSP pages and Enterprise JavaBeans (EJBs):

  1. Lookup the EJBs from within a JSP, but use the EJBs from within a basic JavaBean.

  2. Lookup and use the EJBs from a separate business delegate. The JavaBeans that work with JSP pages are clients to these business delegates and know nothing about EJB specifics.

  3. Lookup and use the EJBs from within a JSP page, but only as remote references.

  4. Lookup the EJBs from within a servlet, delegating usage to specific JSP pages.


Correct Option: B

AI Explanation

To answer this question, let's go through each option to understand why it is correct or incorrect:

Option A) Lookup the EJBs from within a JSP, but use the EJBs from within a basic JavaBean. This option is incorrect because it suggests using the EJBs from within a basic JavaBean, which is not the recommended approach for connecting JSP pages and EJBs.

Option B) Lookup and use the EJBs from a separate business delegate. The JavaBeans that work with JSP pages are clients to these business delegates and know nothing about EJB specifics. This option is correct because it suggests using a separate business delegate to lookup and use the EJBs. The JavaBeans that work with JSP pages act as clients to these business delegates and are unaware of the specific details of the EJBs. This approach helps to decouple the JSP pages from the EJB specifics, providing better maintainability and flexibility.

Option C) Lookup and use the EJBs from within a JSP page, but only as remote references. This option is incorrect because it suggests using the EJBs as remote references directly within the JSP page. While it is possible to do so, it is generally not recommended as it violates the principle of separation of concerns and can make the JSP page tightly coupled to the EJBs.

Option D) Lookup the EJBs from within a servlet, delegating usage to specific JSP pages. This option is incorrect because it suggests looking up the EJBs from within a servlet and then delegating usage to specific JSP pages. While this approach is possible, it is not the best practice as it introduces unnecessary complexity and violates the principle of separation of concerns.

The correct answer is B. This option describes the recommended approach for connecting JSP pages and EJBs by using a separate business delegate to lookup and use the EJBs, while the JavaBeans that work with JSP pages act as clients to these business delegates and are unaware of the EJB specifics.

What type of scriptlet code is better-suited to being factored forward into a servlet?

  1. Code that deals with logic that is common across requests.

  2. Code that deals with logic that is vendor specific.

  3. Code that deals with logic that relates to database access.

  4. Code that deals with logic that relates to client scope.


Correct Option: A

What alternatives exist to embedding Java code directly within the HTML markup of your JSP page?

  1. Moving the code into your session manager.

  2. Moving the code into scriptlets.

  3. Moving the code into JavaBeans and servlets.

  4. Moving the code into a transaction manager.


Correct Option: C

AI Explanation

To answer this question, you need to understand the alternatives to embedding Java code directly within the HTML markup of a JSP (JavaServer Pages) page. Let's go through each option to understand why it is correct or incorrect:

Option A) Moving the code into your session manager - This option is incorrect because the session manager is responsible for managing user sessions and maintaining session data. It does not provide an alternative for embedding Java code within the HTML markup of a JSP page.

Option B) Moving the code into scriptlets - This option is incorrect because scriptlets are a way to embed Java code directly within the HTML markup of a JSP page. It does not provide an alternative to embedding Java code.

Option C) Moving the code into JavaBeans and servlets - This option is correct because JavaBeans and servlets provide an alternative to embedding Java code directly within the HTML markup of a JSP page. JavaBeans are reusable components that encapsulate data and business logic, while servlets handle the request and response processing. By moving the code into JavaBeans and servlets, you can separate the business logic from the presentation layer, improving code modularity and maintainability.

Option D) Moving the code into a transaction manager - This option is incorrect because a transaction manager is responsible for managing database transactions and ensuring data consistency. It does not provide an alternative for embedding Java code within the HTML markup of a JSP page.

Therefore, the correct answer is Option C) Moving the code into JavaBeans and servlets. This option is correct because it provides an alternative to embedding Java code directly within the HTML markup of a JSP page by separating the business logic into reusable JavaBeans and servlets.

Why use RequestDispatcher to forward a request to another resource, instead of using a sendRedirect?

  1. Redirects are no longer supported in the current servlet API.

  2. Redirects are not a cross-platform portable mechanism.

  3. The RequestDispatcher does not use the reflection API.

  4. The RequestDispatcher does not require a round trip to the client, and thus is more efficient and allows the server to maintain request state.


Correct Option: D

What is a benefit of using JavaBeans to separate business logic from presentation markup within the JSP environment?

  1. It allows the JSP to access middleware.

  2. It creates a cleaner role separation between the web-production team and the software development team, so that the web-production team can focus on presentation markup, while the software team can focus on building reusable software components for helpin

  3. It provides a dynamic markup environment, such that JavaBeans are integrated seamlessly with the template presentation content, in order to create the dynamic display for the client.

  4. It provides the developer with full access to the Java 2 Platform Enterprise Edition (J2EE), which is unavailable from outside the JavaBean environment.


Correct Option: B

AI Explanation

To answer this question, let's go through each option to understand why it is correct or incorrect:

Option A) It allows the JSP to access middleware - This option is incorrect because JavaBeans itself does not directly enable JSP to access middleware. However, JavaBeans can be used in conjunction with other technologies to access middleware.

Option B) It creates a cleaner role separation between the web-production team and the software development team, so that the web-production team can focus on presentation markup, while the software team can focus on building reusable software components for helping - This option is correct. JavaBeans provide a way to separate business logic from presentation markup within the JSP environment. This separation allows the web-production team to focus on the presentation markup, while the software development team can focus on building reusable software components (JavaBeans) that handle the business logic.

Option C) It provides a dynamic markup environment, such that JavaBeans are integrated seamlessly with the template presentation content, in order to create the dynamic display for the client - This option is incorrect. While JavaBeans can be used to create a dynamic display for the client, it does not specifically provide a dynamic markup environment. JSP itself provides the dynamic markup environment by allowing the integration of JavaBeans with the template presentation content.

Option D) It provides the developer with full access to the Java 2 Platform Enterprise Edition (J2EE), which is unavailable from outside the JavaBean environment - This option is incorrect. JavaBeans do not provide exclusive access to the Java 2 Platform Enterprise Edition (J2EE). J2EE is a separate platform that JavaBeans can be used with, but it is not limited to JavaBeans.

The correct answer is B. It creates a cleaner role separation between the web-production team and the software development team, so that the web-production team can focus on presentation markup, while the software team can focus on building reusable software components for helping. This option highlights one of the benefits of using JavaBeans to separate business logic from presentation markup within the JSP environment.

Choose the statement that best describes the relationship between JSP and servlets:

  1. Servlets are built on JSP semantics and all servlets are compiled to JSP pages for runtime usage.

  2. JSP and servlets are unrelated technologies.

  3. Servlets and JSP are competing technologies for handling web requests. Servlets are being superseded by JSP, which is preferred. The two technologies are not useful in combination.

  4. JSPs are built on servlet semantics and all JSPs are compiled to servlets for runtime usage.


Correct Option: D
Explanation:

To answer this question, the user needs to have a basic understanding of JSP and servlets.

Option A is incorrect. Servlets and JSPs are separate technologies and are not compiled to each other.

Option B is incorrect. JSP and servlets are related technologies used for web development.

Option C is incorrect. Servlets and JSPs are complementary technologies that can be used together to handle web requests.

Option D is correct. JSPs are built on top of the Servlet API and are ultimately compiled down to servlets.

Therefore, the correct answer is:

The Answer is: D

A tag library is a collection of custom tags.

  1. True

  2. False


Correct Option: A

Inside which HTML element do we put the JavaScript?


Correct Option: A

What is the correct JavaScript syntax to write "Hello World"?

  1. response.write("Hello World")

  2. "Hello World"

  3. document.write("Hello World")

  4. ("Hello World")


Correct Option: C

AI Explanation

To answer this question, you need to understand the correct syntax for outputting text in JavaScript.

Let's go through each option to understand why it is correct or incorrect:

Option A) response.write("Hello World") - This option is incorrect. "response.write" is not a valid JavaScript syntax for outputting text.

Option B) "Hello World" - This option is incorrect. While it is a valid string value, it is not being outputted to the document.

Option C) document.write("Hello World") - This option is correct. The "document.write" function is a valid JavaScript syntax for outputting text to the document.

Option D) ("Hello World") - This option is incorrect. The parentheses are not necessary and do not form a valid syntax for outputting text.

The correct answer is C) document.write("Hello World"). This option is correct because it uses the correct JavaScript syntax to output the text "Hello World" to the document.

Where is the correct place to insert a JavaScript?

  1. The section

  2. Both the section and the section are correct

  3. The section

  4. None of the above


Correct Option: B
- Hide questions