2.1 Identify the structure of a web application and web archive file, the name of the WebApp deployment descriptor, and the name of the directories where you place the following:
The WebApp deployment descriptor
The WebApp class files
Any auxiliary JAR files
2.2 Match the name with a description of purpose or functionality, for each of the following deployment descriptor elements:
Servlet instance
Servlet name
Servlet class
Initialization parameters
URL to named servlet mapping
2.1 Identify the structure of a web application and web archive file, the name of the WebApp deployment descriptor, and the name of the directories where you place the following:
The WebApp deployment descriptor
The WebApp class files
Any auxiliary JAR files
2.2 Match the name with a description of purpose or functionality, for each of the following deployment descriptor elements:
Servlet instance
Servlet name
Servlet class
Initialization parameters
URL to named servlet mapping
2.1 Identify the structure of a web application and web archive file, the name of the WebApp deployment descriptor, and the name of the directories where you place the following:
The WebApp deployment descriptor
The WebApp class files
Any auxiliary JAR files
2.2 Match the name with a description of purpose or functionality, for each of the following deployment descriptor elements:
Servlet instance
Servlet name
Servlet class
Initialization parameters
URL to named servlet mapping
Setting up the Red5 environment, building sample applications and integrating with flash. We will look at how Red5 works within the flash IDE and build a sample chat application, video streaming, and multi-user environment.
JAVA EE DEVELOPMENT (JSP and Servlets)Talha Ocakçı
Java and J2EE is the most used technologies in enterprise web development. Telecom operators, service providers are using these technlogies; banking and insurance companies are moving to Java from old generation technologies.
https://www.udemy.com/java-web-developmen-with-real-world-development-flow
If you want to earn much in web development business, you also need to learn Java web technologies.
Java has de facto standart frameworks such as EJB 3.0, Spring and others that can be bound to them.
But at heart, they all use the similar JSP/Servlet technology and add some layers above them to speed up the development.
You will use them in your daily business but before using them, you must learn the basics and what is going on while using them. Otherwise, you will not be able to find a proper solution to common problems.
This course will make you understand the basics of JSP / servlet technlogies, designing a relational database, DB operations, design patterns, working with other developers,
and let you know the must-do operations in professional projects such as performance increasing, logging errors.
If you want to develop a web-site in a couple of hours without understanding what you are doing, you may go ahead and find other resources. But if you really want to understand what you are doing and learn the theory at the same time, this course will be a great oppurtunity for you. You will develop a real working project. Yow will first write quick and dirty code then you will apply professional patterns one by one while investigating the problems.
You will walk through a real development flow:
1- Write a quick and dirty code for doing the job.
2- You will design database tables and high performance queries
3 - You will apply design patterns to make the code reusable and high performance.
4 - You will beautify the user interface with Javascript and CSS tweaks
5- You will add exception handling, logging mechanism for production environment
6- AT THIS STEP, YOU WILL BE HIRED FOR MUCH MUCH HIGHER SALARIES. BECAUSE YOU ARE A REAL PROFESSIONAL.
Tuning and optimizing webcenter spaces application white paperVinay Kumar
This white paper focuses on Oracle WebCenter Spaces performance problem and analysis after post production deployment. We will tune JVM ( JRocket). Webcenter Portal, Webcenter content and ADF task flow.
Setting up the Red5 environment, building sample applications and integrating with flash. We will look at how Red5 works within the flash IDE and build a sample chat application, video streaming, and multi-user environment.
JAVA EE DEVELOPMENT (JSP and Servlets)Talha Ocakçı
Java and J2EE is the most used technologies in enterprise web development. Telecom operators, service providers are using these technlogies; banking and insurance companies are moving to Java from old generation technologies.
https://www.udemy.com/java-web-developmen-with-real-world-development-flow
If you want to earn much in web development business, you also need to learn Java web technologies.
Java has de facto standart frameworks such as EJB 3.0, Spring and others that can be bound to them.
But at heart, they all use the similar JSP/Servlet technology and add some layers above them to speed up the development.
You will use them in your daily business but before using them, you must learn the basics and what is going on while using them. Otherwise, you will not be able to find a proper solution to common problems.
This course will make you understand the basics of JSP / servlet technlogies, designing a relational database, DB operations, design patterns, working with other developers,
and let you know the must-do operations in professional projects such as performance increasing, logging errors.
If you want to develop a web-site in a couple of hours without understanding what you are doing, you may go ahead and find other resources. But if you really want to understand what you are doing and learn the theory at the same time, this course will be a great oppurtunity for you. You will develop a real working project. Yow will first write quick and dirty code then you will apply professional patterns one by one while investigating the problems.
You will walk through a real development flow:
1- Write a quick and dirty code for doing the job.
2- You will design database tables and high performance queries
3 - You will apply design patterns to make the code reusable and high performance.
4 - You will beautify the user interface with Javascript and CSS tweaks
5- You will add exception handling, logging mechanism for production environment
6- AT THIS STEP, YOU WILL BE HIRED FOR MUCH MUCH HIGHER SALARIES. BECAUSE YOU ARE A REAL PROFESSIONAL.
Tuning and optimizing webcenter spaces application white paperVinay Kumar
This white paper focuses on Oracle WebCenter Spaces performance problem and analysis after post production deployment. We will tune JVM ( JRocket). Webcenter Portal, Webcenter content and ADF task flow.
Web Component Development Using Servlet & JSP Technologies (EE6) - Chapter 5...WebStackAcademy
Introduction
The server hands requests to a Container in which the servlet is deployed. The Container gives the servlet the HTTP request and response, and calls the servlet's method, such as doPost() or doGet(). It creates the HttpServletResponse and HttpServletRequest objects.
Process:
Container creates HttpServletRequest/HttpServletResponse objects
Container determines servlet based on URL-pattern, creates thread and calls service()
services calls doGet() or doPost()
servlet writes to response
service() completes, control returns to container
thread dies or returns to pool
The container provides:
web app communications support
lifecycle management
multithreading support
declarative security
support for JSPs
HTTP Session Replication with Oracle Coherence, GlassFish, WebLogicOracle
In this talk we will cover the integration of Coherence and Application Servers like Oracle WebLogic and Oracle GlassFish Server, and touch on the native capabilities of each server for HTTP session state management as well. The integration makes it simpler to access Coherence named caches through resource injection. It also provides an optimized integration of Coherence*Web for HTTP session state management. From a management perspective, it offers Coherence cluster configuration support through the WLS administration domain as well as Runtime monitoring support through the WebLogic console.
Transaction processing is very important and also necessary to maintain data integrity in both your application and database.
The transaction design patterns that are described in the next are :
Client Owner Transaction Design Pattern
Domain Service Owner Transaction Design Pattern
Server Delegate Owner Transaction Design Pattern
Transaction management in Java does not have to be complicated using the transaction design patterns described in this chapter makes transaction processing easy to understand, implement, and maintain.
8.1 Write the opening and closing tags for the following JSP tag
types: Directive ,Declaration ,Scriptlet ,Expression .
8.2 Given a type of JSP tag, identify correct statements about its purpose or use.
8.3 Given a JSP tag type, identify the equivalent XML-based tags.
8.4 Identify the page directive attribute, and its values, that:
Import a Java class into the JSP page
Declare that a JSP page exists within a session
Declare that a JSP page uses an error page
Declare that a JSP page is an error page
8.5 Identify and put in sequence the following elements of the JSP page life cycle: Page translation ,JSP page compilation, Load class,Create instance,Call jspInit,Call _jspService ,Call jspDestroy .
8.6 Match correct descriptions about purpose, function, or use with any of the following implicit objects: request, response ,out ,session ,config ,application ,Page ,pageContext, exception .
8.7 Distinguish correct and incorrect scriptlet code for: A conditional statement , An iteration statement
9.1 Given a description of required functionality, identify the JSP page directive or standard tag in the correct format with the correct attributes required to specify the inclusion of a web component into the JSP page.
1.1 For each of the HTTP methods,GET,POST, andPUT, identifythe corresponding method in the HttpServletclass.
1.3 For each of the following operations, identify the interfaceand method name that should be used:
Retrieve HTML form parameters from the request
Retrieve a servlet initialization parameter
Retrieve HTTP request header information
Set an HTTP response header
set the content type of the response
Acquire a text stream for the response
Acquire a binary stream for the response
Redirect an HTTP request to another URL
1.4 Identify the interface and method to access values and resources and to set object attributes within the following three web scopes:
Request
Session
Context
1.5 Given a life-cycle method: init,service , or destroy, identify correct statements bout its purpose or about how and when it is invoked.
1.6 Use a RequestDispatcher to include or forward to a web resource.
Introduce the Java Enterprise (J2EE) model
Present the Hypertext Markup Language (HTML) tags
Present the Hypertext Transmission Protocol (HTTP)
Define an HTTP client request, server response, and HTTP request methods
7.1 Identify which attribute scopes are thread-safe:
Local variables
Instance variables
Class variables
Request attributes
Session attributes
Context attributes
7.2 Identify correct statements about differences between the multithreaded and single-threaded servlet models.
7.3 Identify the interface used to declare that a servlet must use the single thread model.
7.1 Identify which attribute scopes are thread-safe:
Local variables
Instance variables
Class variables
Request attributes
Session attributes
Context attributes
7.2 Identify correct statements about differences between the multithreaded and single-threaded servlet models.
7.3 Identify the interface used to declare that a servlet must use the single thread model.
6.1 Identify correct descriptions or statements about the security issues:
Authentication
authorization
Data integrity
Auditing
Malicious code
Website attacks
6.2 Identify the deployment descriptor element names, and their structure, that declare the following:
A security constraint
A web resource
The login configuration
A security role
6.3 Given authentication type: BASIC, DIGEST, FORM, and CLIENT-CERT, identify the correct definition of its mechanism.
5.1 Identify the interface and methods for each of the following:
Retrieve a session object across multiple requests to the same or different servlets within the same WebApp
Store objects into a session object
Retrieve objects from a session object
Respond to the event when a particular object is added to a session
Respond to the event when a session is created and destroyed
Expunge a session object
5.2 Given a scenario, state whether a session object will be invalidated.
5.3 Given that URL rewriting must be used for session management, identify the design requirements on sessionrelated HTML pages.
3.1 Identify the uses for and the interfaces (or classes) and methods to achieve the following features:
Servlet context init. Parameters
Servlet context listener
Servlet context attribute listener
Session attribute listeners
3.2 Identify the WebApp deployment descriptor element name that declares the following features:
Servlet context init. Parameters
Servlet context listener
Servlet context attribute listener
Session attribute listeners
3.1 Identify the uses for and the interfaces (or classes) and methods to achieve the following features:
Servlet context init. Parameters
Servlet context listener
Servlet context attribute listener
Session attribute listeners
3.2 Identify the WebApp deployment descriptor element name that declares the following features:
Servlet context init. Parameters
Servlet context listener
Servlet context attribute listener
Session attribute listeners
1.1 For each of the HTTP methods,GET,POST, andPUT, identifythe corresponding method in the HttpServletclass.
1.3 For each of the following operations, identify the interfaceand method name that should be used:
Retrieve HTML form parameters from the request
Retrieve a servlet initialization parameter
Retrieve HTTP request header information
Set an HTTP response header
set the content type of the response
Acquire a text stream for the response
Acquire a binary stream for the response
Redirect an HTTP request to another URL
1.4 Identify the interface and method to access values and resources and to set object attributes within the following three web scopes:
Request
Session
Context
1.5 Given a life-cycle method: init,service , or destroy, identify correct statements bout its purpose or about how and when it is invoked.
1.6 Use a RequestDispatcher to include or forward to a web resource.
THE FOLLOWING SUN CERTIFIED WEBCOMPONENT DEVELOPER FOR J2EEPLATFORM EXAM OBJECTIVES COVERED IN THIS CHAPTER:
1.1 For each of the HTTP methods,GET,POST, and PUT, identify the corresponding method in the HttpServlet class.
1.2 For each of the HTTP methods,GET ,POST, and HEAD, identify triggers that might cause a browser to use the method, and identify benefits or functionality of the method.
13.1 Given a scenario description with a list of issues, select the design pattern (Value Object, MVC, Data Access Object, or Business Delegate) that would best solve those issues.
13.2 Match design patterns with statements describing potential benefits that accrue from the use of the pattern, for any of the following patterns:
Value Object
MVC
Data Access Object
Business Delegate
Kubernetes & AI - Beauty and the Beast !?! @KCD Istanbul 2024Tobias Schneck
As AI technology is pushing into IT I was wondering myself, as an “infrastructure container kubernetes guy”, how get this fancy AI technology get managed from an infrastructure operational view? Is it possible to apply our lovely cloud native principals as well? What benefit’s both technologies could bring to each other?
Let me take this questions and provide you a short journey through existing deployment models and use cases for AI software. On practical examples, we discuss what cloud/on-premise strategy we may need for applying it to our own infrastructure to get it to work from an enterprise perspective. I want to give an overview about infrastructure requirements and technologies, what could be beneficial or limiting your AI use cases in an enterprise environment. An interactive Demo will give you some insides, what approaches I got already working for real.
Essentials of Automations: Optimizing FME Workflows with ParametersSafe Software
Are you looking to streamline your workflows and boost your projects’ efficiency? Do you find yourself searching for ways to add flexibility and control over your FME workflows? If so, you’re in the right place.
Join us for an insightful dive into the world of FME parameters, a critical element in optimizing workflow efficiency. This webinar marks the beginning of our three-part “Essentials of Automation” series. This first webinar is designed to equip you with the knowledge and skills to utilize parameters effectively: enhancing the flexibility, maintainability, and user control of your FME projects.
Here’s what you’ll gain:
- Essentials of FME Parameters: Understand the pivotal role of parameters, including Reader/Writer, Transformer, User, and FME Flow categories. Discover how they are the key to unlocking automation and optimization within your workflows.
- Practical Applications in FME Form: Delve into key user parameter types including choice, connections, and file URLs. Allow users to control how a workflow runs, making your workflows more reusable. Learn to import values and deliver the best user experience for your workflows while enhancing accuracy.
- Optimization Strategies in FME Flow: Explore the creation and strategic deployment of parameters in FME Flow, including the use of deployment and geometry parameters, to maximize workflow efficiency.
- Pro Tips for Success: Gain insights on parameterizing connections and leveraging new features like Conditional Visibility for clarity and simplicity.
We’ll wrap up with a glimpse into future webinars, followed by a Q&A session to address your specific questions surrounding this topic.
Don’t miss this opportunity to elevate your FME expertise and drive your projects to new heights of efficiency.
Transcript: Selling digital books in 2024: Insights from industry leaders - T...BookNet Canada
The publishing industry has been selling digital audiobooks and ebooks for over a decade and has found its groove. What’s changed? What has stayed the same? Where do we go from here? Join a group of leading sales peers from across the industry for a conversation about the lessons learned since the popularization of digital books, best practices, digital book supply chain management, and more.
Link to video recording: https://bnctechforum.ca/sessions/selling-digital-books-in-2024-insights-from-industry-leaders/
Presented by BookNet Canada on May 28, 2024, with support from the Department of Canadian Heritage.
UiPath Test Automation using UiPath Test Suite series, part 4DianaGray10
Welcome to UiPath Test Automation using UiPath Test Suite series part 4. In this session, we will cover Test Manager overview along with SAP heatmap.
The UiPath Test Manager overview with SAP heatmap webinar offers a concise yet comprehensive exploration of the role of a Test Manager within SAP environments, coupled with the utilization of heatmaps for effective testing strategies.
Participants will gain insights into the responsibilities, challenges, and best practices associated with test management in SAP projects. Additionally, the webinar delves into the significance of heatmaps as a visual aid for identifying testing priorities, areas of risk, and resource allocation within SAP landscapes. Through this session, attendees can expect to enhance their understanding of test management principles while learning practical approaches to optimize testing processes in SAP environments using heatmap visualization techniques
What will you get from this session?
1. Insights into SAP testing best practices
2. Heatmap utilization for testing
3. Optimization of testing processes
4. Demo
Topics covered:
Execution from the test manager
Orchestrator execution result
Defect reporting
SAP heatmap example with demo
Speaker:
Deepak Rai, Automation Practice Lead, Boundaryless Group and UiPath MVP
Key Trends Shaping the Future of Infrastructure.pdfCheryl Hung
Keynote at DIGIT West Expo, Glasgow on 29 May 2024.
Cheryl Hung, ochery.com
Sr Director, Infrastructure Ecosystem, Arm.
The key trends across hardware, cloud and open-source; exploring how these areas are likely to mature and develop over the short and long-term, and then considering how organisations can position themselves to adapt and thrive.
Smart TV Buyer Insights Survey 2024 by 91mobiles.pdf91mobiles
91mobiles recently conducted a Smart TV Buyer Insights Survey in which we asked over 3,000 respondents about the TV they own, aspects they look at on a new TV, and their TV buying preferences.
Connector Corner: Automate dynamic content and events by pushing a buttonDianaGray10
Here is something new! In our next Connector Corner webinar, we will demonstrate how you can use a single workflow to:
Create a campaign using Mailchimp with merge tags/fields
Send an interactive Slack channel message (using buttons)
Have the message received by managers and peers along with a test email for review
But there’s more:
In a second workflow supporting the same use case, you’ll see:
Your campaign sent to target colleagues for approval
If the “Approve” button is clicked, a Jira/Zendesk ticket is created for the marketing design team
But—if the “Reject” button is pushed, colleagues will be alerted via Slack message
Join us to learn more about this new, human-in-the-loop capability, brought to you by Integration Service connectors.
And...
Speakers:
Akshay Agnihotri, Product Manager
Charlie Greenberg, Host
State of ICS and IoT Cyber Threat Landscape Report 2024 previewPrayukth K V
The IoT and OT threat landscape report has been prepared by the Threat Research Team at Sectrio using data from Sectrio, cyber threat intelligence farming facilities spread across over 85 cities around the world. In addition, Sectrio also runs AI-based advanced threat and payload engagement facilities that serve as sinks to attract and engage sophisticated threat actors, and newer malware including new variants and latent threats that are at an earlier stage of development.
The latest edition of the OT/ICS and IoT security Threat Landscape Report 2024 also covers:
State of global ICS asset and network exposure
Sectoral targets and attacks as well as the cost of ransom
Global APT activity, AI usage, actor and tactic profiles, and implications
Rise in volumes of AI-powered cyberattacks
Major cyber events in 2024
Malware and malicious payload trends
Cyberattack types and targets
Vulnerability exploit attempts on CVEs
Attacks on counties – USA
Expansion of bot farms – how, where, and why
In-depth analysis of the cyber threat landscape across North America, South America, Europe, APAC, and the Middle East
Why are attacks on smart factories rising?
Cyber risk predictions
Axis of attacks – Europe
Systemic attacks in the Middle East
Download the full report from here:
https://sectrio.com/resources/ot-threat-landscape-reports/sectrio-releases-ot-ics-and-iot-security-threat-landscape-report-2024/
Neuro-symbolic is not enough, we need neuro-*semantic*Frank van Harmelen
Neuro-symbolic (NeSy) AI is on the rise. However, simply machine learning on just any symbolic structure is not sufficient to really harvest the gains of NeSy. These will only be gained when the symbolic structures have an actual semantics. I give an operational definition of semantics as “predictable inference”.
All of this illustrated with link prediction over knowledge graphs, but the argument is general.
"Impact of front-end architecture on development cost", Viktor TurskyiFwdays
I have heard many times that architecture is not important for the front-end. Also, many times I have seen how developers implement features on the front-end just following the standard rules for a framework and think that this is enough to successfully launch the project, and then the project fails. How to prevent this and what approach to choose? I have launched dozens of complex projects and during the talk we will analyze which approaches have worked for me and which have not.
Software Delivery At the Speed of AI: Inflectra Invests In AI-Powered QualityInflectra
In this insightful webinar, Inflectra explores how artificial intelligence (AI) is transforming software development and testing. Discover how AI-powered tools are revolutionizing every stage of the software development lifecycle (SDLC), from design and prototyping to testing, deployment, and monitoring.
Learn about:
• The Future of Testing: How AI is shifting testing towards verification, analysis, and higher-level skills, while reducing repetitive tasks.
• Test Automation: How AI-powered test case generation, optimization, and self-healing tests are making testing more efficient and effective.
• Visual Testing: Explore the emerging capabilities of AI in visual testing and how it's set to revolutionize UI verification.
• Inflectra's AI Solutions: See demonstrations of Inflectra's cutting-edge AI tools like the ChatGPT plugin and Azure Open AI platform, designed to streamline your testing process.
Whether you're a developer, tester, or QA professional, this webinar will give you valuable insights into how AI is shaping the future of software delivery.
2. 2
THE FOLLOWING SUN CERTIFIED WEB COMPONENT DEVELOPER
FOR J2EE PLATFORM EXAM OBJECTIVES COVERED IN THIS
CHAPTER:
• 2.1 Identify the structure of a web application and web archive file, the name of
the WebApp deployment descriptor, and the name of the directories where you
place the following:
> The WebApp deployment descriptor
> The WebApp class files
> Any auxiliary JAR files
• 2.2 Match the name with a description of purpose or functionality, for each of the
following deployment descriptor elements:
> Servlet instance
> Servlet name
> Servlet class
> Initialization parameters
> URL to named servlet mapping
3. 3
• In this chapter, we will classify the various parts of a web
application and identify where these parts must be
placed.
• The directory layout is the key behind the container’s
ability to locate the data it needs.
4. 4
Understanding a Web Application
• It takes many pieces to make a final program that is accessible
through the Web. These pieces, when grouped together, are referred
to as the web application . A single application can consist of any or
all of the following elements:
• Servlets
• JSP pages
• Utility classes
• Static documents
• Client-side Java applets, beans, and classes
• A standard configuration file (required)
5. 5
Understanding a Directory Structure
The hierarchy is made up of three significant layers.
1. The first is the context.It is one or more directories used to locate the web
application associated to the client request.
2. Within the context exists the /WEB-INF directory. It contains several
subdirectories that help organize class files and compressed Java files.
The /WEB-INF directory also contains web.xml. This layer is hidden from
the client. the client cannot directly access files from within the /WEB-INF
directory.
3. The final layer is quite the opposite. It is located directly within the context
and contains all client-viewable files. This includes welcome and error
pages, graphic or audio files, and so forth.
6. 6
The Context
The context itself is the root for a single web application.
The container then locates the servlet by using the following mapping
rules in the order they are performed. Assuming that the “servlet
path pattern” defines the request URL and the “incoming path”
defines the longest context path match, the servlet container will try
to find:
Exact mapping : All strings match exactly. Here is an example of a
match:
Servlet path pattern: /foo/bar
Incoming path: /foo/bar
Path mapping : The string begins with a forward slash (/) and ends
witha forward slash and asterisk (/*). The longest match determines
the servlet requested.
Here is an example of a match:
Servlet path pattern: /programs/wordprocessing/*
Incoming path: /programs/wordprocessing/index.html
Incoming path: /programs/wordprocessing/wp2.4/start.jsp
7. 7
Extension mapping :The string begins with an asterisk (*).
Here is an example of a match:
Servlet path pattern:*.jsp
Incoming path:/catalog/order/start.jsp
Incoming path:/catalog/form.jsp
Incoming path:/test.jsp
Default mapping :The container provides server content appropriate for the
resource request, such as a default servlet. The string begins with a forward
slash (/), and the servlet path is the requested URI minus the context path.
The path info is null.
Here is an example of a match:
Servlet path pattern: /sport
Incoming path: /sport/index.html
8. 8
• Request mapping is case sensitive.
• Containers often have implicit mapping mechanisms built into their
systems. For example, a container might have *.jsp extensions
mapped to enable JSP pages to be executed on demand. The keynote
is that explicit mapping by a web application or servlet takes
precedence over implicit mapping.
9. 9
WEB-INF
• This directory contains the main files for the application
that are not provided to the client by the container.
• Through the ServletContext object, which the servlet
acquires by using the getServletContext() method, a
servlet can access files and code in the /WEB-INF
directory by using the following methods:
• URL getResource(String path)
• InputStream getResourceAsStream(String path)
10. 10
There are three main categories for content
in the /WEB-INF directory:
• /WEB-INF/web.xml This contains the deployment
descriptor.
• /WEB-INF/classes This directory contains all the server-
side Java classes, such as servlet and utility classes.
• /WEB-INF/lib/*.jar The /lib directory contains all necessary
compressed Java files that are used for the web
application. These files are referred to as Java archive files
or JAR files. They can consist of servlets, JSPs, beans,
and utility classes.
When loading classes from the /WEB-INF directory, the ClassLoader
first loads from the /classes directory and then the /lib directory.
11. 11
Web Application Archive File (WAR File)
You can create a WAR file by using the following command-line
statement:
jar -cvf ShoppingCart.war *
Or you can extract a WAR file by using the following command:
jar -xvf ShoppingCart.war
The minus sign in front of the options is not
mandatory. It is used only as a convention
carried forward from Unix. The option tags can
be placed in any order.
15. 15
• If you don’t include a context tag, the container assumes a
default context of ‘/’.
• Within the opening and closing context tags, you can define
parameters that are available to all servlets within the web
application.
• By using the ServletContext method getInitParameter(…), you
can pass in the param-name and have the param-value
returned within the servlet.
• Remember, the value is always represented as a String.
18. 18
Mapping the URL to the Servlet
http://localhost:8080/features/utilities/Search
From this request, we can extract the URI:
URI = features/utilities/Search
The container then uses a default mapping mechanism to find the servlet:
/context_name/servlet/Servlet_Name
The container looks for the context directory /features and finds that it is
located in c:/projects/birdSite/features. The servlet is then mapped to the
url-pattern directory /utilities, and the alias name Search is then mapped
to a class file called SearchServlet.
The complete location would
look like the following:
c:/projects/birdSite/features/utilities/SearchServlet.class
19. 19
Based on the information provided,you, like the container, should be
able to construct the full path for the servlet.
context path = /car/engines
docbase= c:/projects/
alias name = TurboRacer
servlet-name = com.eei.RaceCarServlet
url-pattern = /vehicles/fast/*
By utilizing all the information, you should map the servlet to the
following location:
c:/projects/car/engines/vehicles/fast/com/eei/RaceCarServlet.class
The container takes the url-pattern (/vehicles/fast) that is associated
to the servlet alias name (TurboRacer) and then maps that name
to the actual servlet class (com.eei.RaceCarServlet).
21. 21
Session Configuration
• If portions of those users are inactive, then the application is
wasting memory resources. A timeout flag can be set two
ways:
1. Within the servlet code, by using the HttpSession object’s
method,setMaxInactiveInterval(int)
2. Within the web.xml file by using the session-config tag.
22. 22
The first approach utilizes servlet code to set the maximum
number of seconds a request can remain inactive. The following
code snippet demonstrates how this can be done:
…
public void doGet(HttpServletRequest req,HttpServletResponse res)
throws ServletException, IOException {
…
HttpSession session = req.getSession();
session.setMaxInactiveInterval(60);
…
}
…
The downside to this approach is that when the number of seconds needs to be
modified, the code itself must be recompiled.
23. 23
Why not use the second approach altogether because it uses
the deployment descriptor to define the value and exclude the
code from the servlet?”
• A developer might opt to choose one approach over the
other because the first applies the timeout value to a
specific servlet, rather than the entire web application.
• The second approach defines the maximum time all
inactive HttpSession objects can exist through the
web.xml file by using the session-config tag.
> <session-config>
> <session-timeout>60</session-timeout>
> </session-config>
24. 24
MIME Type Mappings
• When transmitting information between the client and server,
both parties need to know the format of the content being
transferred.
• The Multipurpose Internet Mail Extensions (MIME) type
defines the format of the request or response.
• A MIME type is a String that defines the type and subtype:
type/subtype. Some common examples are
text/html, text/plain,and image/gif.
25. 25
• When a servlet sends a response to a client, the browser
needs to know how to render the information received.
Consequently, the server can construct a response to
notify the client of the MIME type, by using two different
approaches:
1. By using the HttpServletResponse’s method:
setContentType(…)
2. By using the mime-mapping tag in the web.xml file for
the web application
26. 26
The first approach utilizes servlet code
to set the MIME type of the response.
The following code snippet demonstrates how this can be done:
…
public void doGet(HttpServletRequest req,HttpServletResponse res)
throws ServletException, IOException {
…
res.setContentType(“application/pdf”);
…
}
…
27. 27
• To apply the content type to all public files of a specific
extension within an entire web application, you can use the
mime-mapping tag. The following example demonstrates how
the context will automatically associate the application/pdf
MIME type with all files with the extension of .pdf:
<mime-mapping>
<extension>pdf</extension>
<mime-type>application/pdf</mime-type>
</mime-mapping>
• After the client receives this response, it knows it must use a
tool such as Adobe Acrobat Reader to interpret the .pdf
response.
28. 28
Welcome File List
• The index.html file is the default welcome page for servlets.
Including the welcome-file-list tag in the web.xml file overrides
the server defaults and enables the container to search for
specified welcome pages.
• A welcome list can point the web server to alternative display
pages.
<welcome-file-list>
<welcome-file>index.jsp</welcome-file>
<welcome-file>start.html</welcome-file>
<welcome-file>go.html</welcome-file>
<welcome-file>index.html</welcome-file>
</welcome-file-list>
29. 29
• When SpiderInc.com is accessed, the welcome page index.html
is displayed by default. Now, when the employees/ link is
accessed, the user might be prompted for a login and password
entry.
• After access is granted, then a welcome page could be
generated dynamically to acknowledge the user’s name and
information.
• The welcome page for the employee site is called index.jsp. In
order for the container to associate the index.jsp file to the
welcome page, the file index.jsp must be defined in the web.xml
file with a welcome-file tag.
• This entry identifies additional filenames for the container to look
for when searching for the welcome page for a site. In our
example, the container will first look for index.html.
30. 30
• In our example, the container will first look for index.html.
• If it can find it in the employees/ directory, it will look at the first
filename in the welcome-file list and search for that file next.
• Because index.jsp is found, the container displays that page to
the client. Without the XML entry, the container would fail to
display the starting page because index.html is not available.
31. 31
1
Which of the following item(s) can be included in a web
application?(Choose all that apply.)
A. Servlets
B. Utility classes
C. Client-side beans
D. An image file
32. 32
• A, B, C, D. All the objects defined can be included in a
web
• application.
33. 33
2-Which of the following statements is true?
A. It is mandatory that all servlet-compliant containers
adhere to the structured directory hierarchy defined by the
servlet specification.
B. It is not mandatory or required that all servlet
containers adhere to the directory structure defined by the
specification.
C. In order for a servlet container to be certified by Sun,
it does not need to adhere to the specification.
D. None of the above.
34. 34
• B. Although it is recommended, it is not mandatory or
required that
• all servlet containers adhere to the directory structure
defined by the
• spec. However, to be Sun certified, a servlet container
must meet
• the requirements of the specification.
35. 35
3
Which of the following files could correctly define an entire
web application?
A. chat.war
B. chat.jar
C. chat.xml
D. None of the above
36. 36
• A. Although a JAR file contains compressed classes and
resources for
• a Java application, a WAR file specifically contains these
same types
• of files, but for a web application.
37. 37
4
In which directory are you likely to find the file index.html?
(Assume the context is defined as /cars.)
A. /cars
B. /cars/WEB-INF
C. /cars/WEB-INF/resources
D. /cars/META-INF
38. 38
• A. The index.html file is forwarded to the web client. As a
result, it cannot be located in either the /WEB-INF or
/META-INF directories, or any of their subdirectories.
39. 39
5
Assume the context for the web application you are working
with is /orderApp. In which directory are you most likely to
find the single file Order.class?
A. /orderApp
B. /orderApp/WEB-INF
C. /orderApp/WEB-INF/lib
D. /orderApp/WEB-INF/classes
40. 40
• D. All individual classes are located in the /WEB-
INF/classes directory.
• If the class is compressed and converted to a JAR file, its
JAR file
• needs
• to be placed in the /WEB-INF/lib
• directory.
41. 41
6
Assume the context for the web application you are working
with is /book. In which directory are you most likely to find
the file called BookApp.war?
A. /book
B. /book/WEB-INF
C. /book/WEB-INF/lib
D. /book/META-INF
42. 42
• A. The WAR file is usually stored in the context directory.
Within the file exists the /WEB-INF directory and all its
subdirectories. The
• /META-INF directory must exist within the WAR file as
well.
43. 43
7-Given the following data elements, which answer best maps t
the servlet?
Context path = /bikes/motors
docbase = c:/projects/bikes/motors
Alias name = R6
Servlet name = com.eei.BikeServlet
url-pattern = /vehicles/fast/*
A. c:/projects/bikes/motors/bikes/motors/vehicles/fast/
BikeServlet.class
B. c:/bikes/motors/vehicles/fast/com/eei/BikeServlet.class
C. c:/projects/bikes/motors/vehicles/fast/R6.class
D. c:/projects/bikes/motors/vehicles/fast/com/eei/BikeServlet.cl
44. 44
• D. The docbase identifies the actual directory starting
path for the
• servlet. It includes the context path, so there is no need to
repeat
• the path directory structure. The url-pattern then defines
the specific
• location of each servlet rather than storing them all at the
root. Finally,
• the package structure information is incorporated into the
path to
• locate the end class.
45. 45
8-The <session-timeout></session-timeout> tag must be
embedded in which outer tags?
A. <web-app><session-config>HERE</session-config>
</web-app>
B. <web-app><servlet><servlet-
config>HERE</servletconfig></servlet></web-app>
C. <web-app>HERE</web-app>
D. None of the above
46. 46
• A. The session-timeout tag is used in conjunction with the
• session-config tag. It is not specific to a servlet, but rather
applies
• to all servlets in the defined web application.
47. 47
9
Which of the following XML tags apply features to the entire
web application, rather than to an individual servlet?
(Choose all that apply.)
A. mime-mapping
B. init-param
C. context-param
D. session-config
48. 48
• A, C, D. The mime-mapping tag applies the MIME type for
any file with the specified file extensions. The init-param is
not a correct answer because it provides parameters for a
specific servlet, unlike the context-param tag. This tag is
general to all files in the web application. Finally, the last
option is also correct because the timeout amount defined
with the session-config
• tag applies to all HttpSession objects.
49. 49
10-Which of the following tags is used to identify the
minimum amount of time a container must wait to remove
an inactive HttpSession object?
A. session-config-min
B. session-timeout-min
C. session-timeout-max
D. session-timeout
E. session-config
50. 50
• D. The session-timeout tag identifies the number of
seconds container must wait before removing an inactive
HttpSession object.
51. 51
11-Which of the following methods is used to retrieve the
value associated to the parameter name provided within the
init-param tag?
A. getParameter(String name)
B. getInitParameter(String name)
C. getParameters()
D. None of the above
52. 52
• A. The getParameter(String name) of the ServletRequest
• class is used to retrieve the value associated to the name
passed in for a specific servlet. This should not be
confused with the getInitParameter(String name) method
found in the ServletContext class and used to retrieve
context parameters.
53. 53
12
• What is the return value of a method call to
getInitParameter (String name) if the name passed in is
not found in the web.xml document?
A. A ServletException is thrown.
B. null is returned.
C. A blank string is returned.
D. The code will not compile.
54. 54
• B. When the string passed into the getInitParameter
(String
• name) method cannot be matched to a param-name tag,
null is
• returned.
55. 55
13
• Which opening tag is used to hold content-type mapping
information for a response?
A. content-type
B. mapping-type
C. mime-mapping
D. content-mapping
56. 56
• C. The mime-mapping tag identifies the MIME type for
files with the
• specified file extensions.
57. 57
14
In which directory are you likely to find the file
myServlet.jar?
A. root/WEB-INF
B. root/
C. root/WEB-INF/lib
D. root/META-INF/
58. 58
• C. All Java archive files are read from the /lib directory,
which is
• located inside /WEB-INF.
59. 59
15-Which of the following statements is true?
A. Request mapping is case sensitive.
B. If mapping information is not included, the container
will look to default directories defined by the server’s
deployment descriptor to find the specified servlet.
C. Containers often have implicit mapping mechanisms
built into their systems.
D. All of the above.
60. 60
• D. When matching URL names to their respective files or
directories, the casing is important. This is best explained
when trying to match Java files. A servlet called
MyServlet.class is different from onecalled
Myservlet.class. The next two options are true as
well,because containers resort to default mapping
techniques and are often built with implicit mapping
mechanisms (as defined by the specification).