Skip to content
Snippets Groups Projects
Commit fff2e6e3 authored by Kloosterboer, W.A. (Walter, Student B-BIT)'s avatar Kloosterboer, W.A. (Walter, Student B-BIT)
Browse files

Finished the exercises

parent 675d013f
Branches master
No related tags found
No related merge requests found
<?xml version="1.0" encoding="UTF-8"?>
<project version="4">
<component name="WebContextManager">
<option name="state">
<map>
<entry key="file://$PROJECT_DIR$/src/main/webapp" value="file://$PROJECT_DIR$/src/main/webapp" />
</map>
</option>
</component>
</project>
\ No newline at end of file
......@@ -4,8 +4,6 @@ import java.io.*;
import jakarta.servlet.*;
import jakarta.servlet.http.*;
/** Example of a Servlet that gets an ISBN number and returns the book price
*/
public class TemperatureCalculator extends HttpServlet {
private static final long serialVersionUID = 1L;
......@@ -32,9 +30,9 @@ public class TemperatureCalculator extends HttpServlet {
"</HEAD>\n" +
"<BODY BGCOLOR=\"#FDF5E6\">\n" +
"<H1>" + title + "</H1>\n" +
" <P>ISBN number: " +
" <P>Temperature in Celsius: " +
request.getParameter("temperature") + "\n" +
" <P>Price: " +
" <P>Temperature in Fahrenheit: " +
calculator.getTemperature(request.getParameter("temperature")) +
"</BODY></HTML>");
}
......
......@@ -5,7 +5,7 @@
https://jakarta.ee/xml/ns/jakartaee/web-app_6_0.xsd"
version="6.0">
<display-name>di.Temperature</display-name>
<display-name>di.TemperatureCalculator</display-name>
<welcome-file-list>
<welcome-file>index.html</welcome-file>
......@@ -18,11 +18,11 @@
<servlet>
<description>Temperature Servlet</description>
<display-name>Temperature</display-name>
<servlet-name>Temperature</servlet-name>
<servlet-name>TemperatureCalculator</servlet-name>
<servlet-class>nl.utwente.di.temperatureCalculator.TemperatureCalculator</servlet-class>
</servlet>
<servlet-mapping>
<servlet-name>Temperature</servlet-name>
<url-pattern>/Temperature</url-pattern>
<servlet-name>TemperatureCalculator</servlet-name>
<url-pattern>/temperatureCalculator</url-pattern>
</servlet-mapping>
</web-app>
\ No newline at end of file
......@@ -11,7 +11,7 @@
<body>
<h1>Celsius to Fahrenheit Calculator</h1>
<form ACTION="./temperatureCalculator">
<form ACTION="./TemperatureCalculator">
<p>Enter temperature in Celsius: <input TYPE="TEXT" NAME="temperature"></p>
<input TYPE="SUBMIT">
</form>
......
package nl.utwente.di.bookQuote;
package nl.utwente.di.temperatureCalculator;
import nl.utwente.di.temperatureCalculator.Calculator;
import org.junit.jupiter.api.Assertions;
import org.junit.jupiter.api.Test;
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment