0% found this document useful (0 votes)
2 views9 pages

wtl

The document provides an overview of various technologies including Enterprise Java Beans (EJB), AngularJS, PHP, and JSP, detailing their functionalities and features. It describes EJB as a server-side component for business logic in Java EE applications, AngularJS as a framework for building single-page applications, and PHP as a server-side scripting language for dynamic content. Additionally, it includes a series of questions and answers related to JavaScript, Servlets, JSP, and PHP, aimed at enhancing understanding of these technologies.

Uploaded by

shrushtib27
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
2 views9 pages

wtl

The document provides an overview of various technologies including Enterprise Java Beans (EJB), AngularJS, PHP, and JSP, detailing their functionalities and features. It describes EJB as a server-side component for business logic in Java EE applications, AngularJS as a framework for building single-page applications, and PHP as a server-side scripting language for dynamic content. Additionally, it includes a series of questions and answers related to JavaScript, Servlets, JSP, and PHP, aimed at enhancing understanding of these technologies.

Uploaded by

shrushtib27
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 9

wtl

9--Enterprise Java Beans (EJB) .


J2EE application container contains the components that can be used by the clients for
executing the business logic .These components are known as Enterprise Java Beans (EJB) .
EJB is a server-side component of Java EE used to encapsulate business logic
EJBs run inside an EJB container (like JBoss), providing services like:

Transaction management

Security

Remote method invocation

Concurrency

Messaging (JMS)

Key Features: Component-based, multi-tiered, and scalable Automatically handles: Database


connection pooling Security (login + role-based) Transaction boundaries Asynchronous
communication

Type Description

Session Beans -Handle business logic for client session--

1. Stateless Session Beans -No client-specific data is stored between calls. Example:
AddTwoNumbersBean that adds two integers sent by client.

2. Stateful Session Beans- Maintains client state between method calls. Slower but useful for
shopping carts, login sessions, etc.

Entity Beans- Represent persistent data (like database rows)


Message-Driven Beans -Handle asynchronous messages from other systems (like JMS queues)
The EJB architecture is an extension of Web architecture.

JBoss, now known as WildFly, is an open-source Java EE (Jakarta EE) application server
developed by Red Hat.Open-source Java EE server used to deploy EJBs and Web Apps.

🛠 DESIGN / EXECUTION STEPS


Create a Stateless EJB for business logic (e.g., AddNumbersBean).

Deploy on JBoss Server.

Design HTML form to take inputs.

Write a JSP page to call EJB.

Test the app in the browser.

📋 TEST CASES Open browser → Go to http://localhost:8080/yourApp


Input numbers and check result (e.g., 10 + 20 = 30)

9---AngularJS
What is AngularJS?

AngularJS is an open-source JavaScript framework for building dynamic single page web
applications. Developed by Google, it helps in developing SPAs (Single Page Applications) using
HTML as a template language.

🔹 General Features of AngularJS


Builds Rich Internet Applications (RIA).
Follows MVC architecture for cleaner code.

Cross-browser compatible.

Open-source, free to use.

Simplifies development with data binding, dependency injection, templates, etc.


$destroy: Called manually to clean up scope.

8---struts framework
The execute() method contains core business logic and returns a string indicating next view (success,
error). It’s called by controller after form validation.

7--PHP (PHP: Hypertext Preprocessor)

PHP is a server-side scripting language that generates dynamic content on the server and interacts with databases, forms,
and sessions.

PHP supports easy interaction with databases like MySQL, enabling efficient data handling.
PHP runs on multiple operating systems and works with popular web servers like Apache and Nginx.

Here are 10 viva/oral questions with short answers for each of the following topics:

✅ 4. JavaScript Application with HTML, CSS, Prompt, Alert,


and Validation
1. What is the role of HTML in a web application?

HTML provides the structure and content of the webpage.

2. Why is CSS used?

CSS is used to style and layout the webpage.

3. What is the function of JavaScript in a web app?

JavaScript adds interactivity and logic to the webpage.

4. What does prompt() do in JavaScript?

It displays a dialog box to take input from the user.

5. What is the purpose of alert()?

It shows a popup box with a message for the user.

6. How do you validate a form using JavaScript?

By checking form field values before submitting (e.g., if (name === "") alert("Enter name")).
7. What is DOM in JavaScript?

The Document Object Model allows JavaScript to access and change HTML elements.

8. How do you access an HTML element in JavaScript?

Using document.getElementById() or query selectors.

9. How do you handle events in JavaScript?

Using event listeners like onclick, onchange, etc.

10. Why use client-side validation?

To give immediate feedback and reduce server load.

✅ 5. Servlet Program
1. What is a Servlet?

A Java class used to handle HTTP requests and responses.

2. Which package contains Servlet classes?

javax.servlet and javax.servlet.http.

3. What is the lifecycle of a servlet?

init() → service() → destroy().

4. What is the use of doGet() and doPost()?

They handle GET and POST HTTP requests respectively.

5. Where is the servlet configured?

In web.xml or using @WebServlet annotation.

6. What is the use of HttpServletRequest?

To read data sent by the client (like form input).

7. What is the use of HttpServletResponse?

To send data back to the client.

8. How is a servlet different from a JSP?

Servlets are Java code; JSPs are HTML with embedded Java.

9. Can we use multiple servlets in one app?


Yes, each can handle different URLs.

10. How do you deploy a servlet?

By compiling and packaging in a .war file and deploying to a server like Tomcat.

✅ 6. JSP (JavaServer Pages) Program


1. What is JSP?

A technology to create dynamic web content using Java inside HTML.

2. What are JSP directives?

Special instructions like <%@ page %> that control page behavior.

3. What is a JSP expression?

*A way to output Java value to HTML: <%= expression %>. *

4. What is the difference between JSP and Servlet?

JSP is more suitable for presentation; Servlet for logic.

5. How do you write Java code in JSP?

Using scriptlets: <% ... %>.

6. What is a JSP scriptlet?

Java code written inside <% %> blocks.

7. What is the use of request, response, and session in JSP?

They are implicit objects used for handling web communication.

8. How is a JSP compiled?

It is translated to a servlet behind the scenes.

9. What is a .jsp file?

A file with HTML and embedded Java code, saved with .jsp extension.

10. How do you deploy a JSP?

Place the .jsp file in the web app's directory (like webapps/YourApp/).

✅ 7. PHP and MySQL Dynamic Web App


1. What is PHP?

A server-side scripting language for web development.

2. What is MySQL?

A relational database management system used to store data.

3. How do you connect PHP to MySQL?

Using mysqli_connect() or PDO in PHP.

4. What does $_POST and $_GET mean in PHP?

Superglobals to access form data sent via POST or GET method.

5. How do you insert data into MySQL using PHP?

By writing an INSERT SQL query and executing it via mysqli_query().

6. How can PHP be embedded in HTML?

Using <?php ... ?> tags inside an HTML file.

7. What is a dynamic web page?

A page that displays different content based on database or user input.

8. How do you fetch data from a database in PHP?

*Use SELECT query and functions like mysqli_fetch_assoc(). *

9. What is XAMPP/WAMP?

Local servers that bundle Apache, MySQL, and PHP for development.

10. How do you secure data input in PHP?

By validating and sanitizing user input and using prepared statements.

Would you like sample code snippets or a quiz based on these questions?

You might also like