Complex number calculator built with Java servlets for the Web 2 course at Universidad Rafael Urdaneta. It offers a JSON API and three JSP pages (sign in, sign up, dashboard).
Note: This repository is archived and read-only, and it is coursework.
- Calculator API — add, subtract, multiply and divide, for numbers in rectangular form (
/api/rectangular/...) and polar form (/api/polar/...). The classes areRectangularComplexNumberandPolarComplexNumber. - Accounts —
/api/sign-up,/api/sign-inand/api/sign-out. Users are kept in an in-memoryHashMap, so they are lost when the server restarts. - Pages —
/sign-up,/sign-inand/dashboard, served fromsrc/main/webapp/with their own CSS and JavaScript.
Maven project (complex-number-calculator, version 1.0-SNAPSHOT, packaged as a WAR) using Jakarta Servlet 5.0 and org.json, compiled for Java 8.
mvn clean install
Deploy the resulting WAR from target/ to a Jakarta EE 9 servlet container such as Tomcat 10.
ApiPolarMultiplyServlet and ApiPolarAddServlet both declare the URL pattern /api/polar/add. Most containers refuse to deploy two servlets with the same mapping, so the multiply servlet probably needs /api/polar/multiply.
GNU General Public License v3.0.