Since this not really answers my question, I'm gonna clarify.
3 .jsp pages, index.jsp, calculator.jsp and error.jsp.
index.jsp contains (withoug html and body tags):
<p><b>Enter the Number you want to know the square root of:</b></p>
<form action="calculator.jsp" method="post">
<div><input type="text" name="number_textfield" size="40" /> <input type="submit" value="Send" /></div>
</form>
error.jsp contains (without html body tags):
<%@page isErrorPage="true" import="java.io.*" %>
<%
StringWriter sw = new StringWriter();
PrintWriter pw = new PrintWriter(sw);
exception.printStackTrace(pw);
String exceptionstack = sw.toString();
%>
<p>Path to File causing this error:
<span class="errortext"><%= request.getAttribute("javax.servlet.error.request_uri") %></span><br />
Error Message: <span class="errortext"><%= exception %></span><br />
The Error is: <span class="errortext"><%= exception.getMessage() %></span><br /></p>
<hr />
<p>Exception stack:</p>
<pre class="errortext"><%= exceptionstack %></pre>
<p><a href="../index.jsp">Index Page</a></p>
Now in calculator.jsp....
1) If I leave the textfield empty in index.jsp, I'm gettin displayed the error according to error.jsp.
2) If I enter a number smaller than 0, nothing happens. Now I've tried various methods from there. None of them works.
The calculator.jsp (without body and html tag):
<%@ page errorPage="../WEB-INF/sqrterror.jsp" %>
<%
String number_string = request.getParameter("number_textfield");
double number = Double.parseDouble(number_string);
if (number < 0){
//THAT'S WHAT I'M MISSING HERE :(
%>
<%
}
else{
double sqrt = Math.sqrt(number);
%>
<p>Square Root of <%= number %> is <%= sqrt %> .</p>
<p><a href="../A03/sqrtcalculator.jsp">Back to Index Page</a></p>
<%
}
%>