# Repository Overview

Welcome to the codebase. This repository contains a Java EE web application built on the Fujitsu Futurity platform, using JavaServer Faces (JSF) as its primary web framework. It provides a server-side MVC architecture where incoming HTTP requests are routed through a servlet container, processed by JSF lifecycle phases, and rendered as HTML views. The application includes components for request encoding, application context management, and view logic — typical of enterprise Java web applications from the JSF 1.x / early JSF 2.x era.

If you are new here, this page will give you the big picture. Below you will find a breakdown of the technology stack, a high-level architecture diagram, a guide to each module, and a recommended reading order to get oriented quickly.

## Overview

This project is an enterprise web application built using the **Fujitsu Futurity** framework. It runs inside a standard Java EE servlet container (such as Tomcat, Jetty, or WebLogic) and uses **JavaServer Faces (JSF)** to manage its web layer. The application organizes its code around three main concerns:

- **Request handling** — a servlet filter intercepts incoming requests, and the `FacesServlet` dispatches them through the JSF lifecycle.
- **Application lifecycle** — a context listener (currently a stub) is positioned to react to servlet container events.
- **View rendering** — MVC-style beans and logic classes produce the HTML output served to users.

The repository is relatively small — five tracked Java source files organized across four packages — suggesting it is either an early-stage scaffolding, a focused sub-system, or a minimal example project.

## Technology Stack

| Technology | Role |
|---|---|
| **Java** | Primary programming language |
| **JavaServer Faces (JSF)** | Web framework for component-based UI |
| **javax.servlet** | Servlet API for request filtering and dispatch |
| **JSP** | View technology for rendering HTML pages |
| **JavaBeans** | Data carrier objects (POJOs with getters/setters) |
| **Front Controller** | Architectural pattern used by FacesServlet |

No well-known third-party frameworks (Spring, Hibernate, etc.) were detected from import analysis. The application appears to rely on the core Java EE APIs and the JSF runtime.

## Architecture

The following diagram shows how the main modules relate to each other:

```mermaid
flowchart TD
    A["Servlet Container"] -->|"dispatches"| B["FacesServlet"]
    B -->|"lifecycle"| C["JSF Lifecycle"]
    B -->|"renders"| D["View Pages"]
    C -->|"restore|render"| E["Component Tree"]
    C -->|"binds to"| F["Managed Beans"]
    B -->|"uses"| G["web-full.xml"]
    A -->|"HTTP request"| H["X33JVRequestEncodingSjisFilter"]
    H -->|"chain.doFilter"| B
    I["X33AppContextListener"] -->|"context events"| B
    F -->|"holds data"| J["ACA001SFBean"]
    F -->|"invokes"| K["ACA001SFLogic"]
    K -->|"renders"| D
    style A fill:#e1f5e1
    style B fill:#fff3e0
    style C fill:#e3f2fd
    style D fill:#fce4ec
    style E fill:#f3e5f5
    style F fill:#e8f5e9
    style G fill:#fff9c4
    style H fill:#e1f5fe
    style I fill:#f1f8e9
    style J fill:#e8f5e9
    style K fill:#fff3e0
```

Key observations:

- **FacesServlet** is the central hub. All JSF-managed requests pass through it, and it orchestrates the entire request lifecycle.
- **X33JVRequestEncodingSjisFilter** sits in front of the servlet, acting as a pass-through. Its encoding logic is not yet implemented.
- **X33AppContextListener** is a stub that is not yet wired into the application lifecycle.
- **ACA001SFBean** and **ACA001SFLogic** form a minimal MVC pair that produces view output rendered by the JSF engine.

## Module Guide

### com.fujitsu.futurity.web.x33.filter

This package contains a single servlet filter — `X33JVRequestEncodingSjisFilter` — registered in `web-full.xml`. It appears to have been intended to enforce Shift-JIS (SJIS) encoding on incoming requests targeting the X33 JV subsystem. In its current form, however, the filter passes every request through unchanged with no encoding transformation applied. It is effectively a no-op: the `doFilter()` method calls `chain.doFilter(req, res)` directly, `init()` reads no configuration, and `destroy()` performs no cleanup.

Key class:

- **X33JVRequestEncodingSjisFilter** — implements `javax.servlet.Filter`. Stateless and thread-safe, but not yet doing any character encoding work. Developers should verify whether the intent is to implement the SJIS encoding logic, move encoding to a general-purpose filter, or remove this filter entirely.

### com.fujitsu.futurity.web.x33.listener

This package is positioned to receive web-tier lifecycle events for the X33 subsystem. However, its sole class, `X33AppContextListener`, is currently an **empty class stub** with no methods, fields, or annotations. It was likely scaffolded as a placeholder for future implementation — such as implementing `ServletContextListener` to bootstrap resources on application start or register cleanup hooks on shutdown.

Key class:

- **X33AppContextListener** — empty class in the correct package with a descriptive name. Not yet wired into the application lifecycle via `@WebListener` or `web.xml`.

### eo.web.webview.ACA001SF

This module provides a minimal MVC (Model-View-Controller) pair for handling web view rendering. It follows the classic Struts-style separation: a JavaBean carries data, and a logic class orchestrates processing. The module is consumed by five distinct JSP pages, making it a shared building block in the broader view ecosystem despite its simplicity.

Key classes:

- **ACA001SFBean** — a standard JavaBean holding a single `String` property called `value`. It has a getter (`getValue()`) but no setter, and is used as a scoped variable in JSP views via `<jsp:useBean>`.
- **ACA001SFLogic** — annotated as a "Futurity view logic" class with an `execute()` method that is currently a no-op stub. It follows the common pattern of receiving a request, performing processing, and delegating to a JSP view.

Configuration file `WEBGAMEN_FULL_ACA001.xml` declares both classes, making them available for JSP pages to reference.

### javax.faces.webapp

This is the web-facing entry point for the JavaServer Faces framework. Its primary class, `FacesServlet`, acts as the central dispatcher for all JSF requests — routing incoming HTTP requests through the six-phase JSF lifecycle (Restore View, Apply Request Values, Process Validations, Update Model Values, Invoke Application, Render Response), managing view state, and bridging the servlet container with the JSF component model. It follows the Front Controller pattern, ensuring consistent request handling across the application.

Key class:

- **FacesServlet** — the heart of the JSF web tier. It handles all requests mapped to its URL pattern, determines whether each request is a GET (page render) or POST (form submission), invokes the JSF lifecycle, manages server-side component tree state, and renders the final HTML response. Thread-safe by design, with each request getting its own `FacesContext` instance.

## Getting Started

If you have never seen this codebase before, here is a recommended reading order:

1. **Start here** — you are already on this overview page, which gives you the big picture of what this project does and how its modules fit together.

2. **Read the FacesServlet documentation** — `.codewiki/javax/faces/webapp.md` explains the central request dispatcher and the JSF lifecycle. Understanding this is essential because almost every request in the application flows through it.

3. **Explore the X33 filter** — `.codewiki/com/fujitsu/futurity/web/x33/filter.md` shows how incoming requests are pre-processed before reaching the FacesServlet. Note the encoding gap discussed in the notes.

4. **Review the ACA001SF module** — `.codewiki/eo/web/webview/ACA001SF.md` demonstrates how a typical view logic and bean pair work together to produce rendered output. This is representative of how other view modules in the application are likely structured.

5. **Check the listener** — `.codewiki/com/fujitsu/futurity/web/x33/listener.md` describes the context listener stub. If you are tasked with implementing application startup or shutdown logic, this is where you would begin.

6. **Explore the source directly** — the Java source files live under `full-fixture-codebase/src/java/`. The deployment descriptor `web-full.xml` ties the servlet filter and FacesServlet together with URL mappings.

### Recommended entry points

| What you want to understand | Start with |
|---|---|
| How requests are processed | `FacesServlet` in `javax/faces/webapp/` |
| How encoding is (not yet) applied | `X33JVRequestEncodingSjisFilter` in `com/fujitsu/futurity/web/x33/filter/` |
| How a view is built | `ACA001SFBean` + `ACA001SFLogic` in `eo/web/webview/ACA001SF/` |
| How the app starts up | `X33AppContextListener` in `com/fujitsu/futurity/web/x33/listener/` |
| How everything is wired together | `web-full.xml` in the web application descriptor |
