You should redirect user to your page with 404 error description (you should use ErrorController for Exception messages rendering) or to the specific page with the message that such student does not exist.
Just throw exception and render the error page in your ErrorController.
You can do like this:
$this->getResponse()->setHttpResponseCode(404);
or
throw new Zend_Controller_Action_Exception('This page does not exist', 404);
The typical ErrorController class is the following:
class ErrorController extends Zend_Controller_Action
{
public function errorAction()
{
$errors = $this->_getParam('error_handler');
switch ($errors->type) {
case Zend_Controller_Plugin_ErrorHandler::EXCEPTION_NO_ROUTE:
case Zend_Controller_Plugin_ErrorHandler::EXCEPTION_NO_CONTROLLER:
case Zend_Controller_Plugin_ErrorHandler::EXCEPTION_NO_ACTION:
// 404 error -- controller or action not found
$this->getResponse()
->setRawHeader('HTTP/1.1 404 Not Found');
// ... get some output to display...
break;
default:
// application error; display error page, but don't
// change status code
break;
}
}
}