How to handle exception in wicket <p>my code:</p> <pre><code>try { LinkedDataForm form = webService.process(searchForm, path); add(new ExternalLink("url", form.getUrl(), form.getUrl())); } catch (Exception e) { add(new Label("error", e.getMessage())); } </code></pre> <p>where: </p> <pre><code>@SpringBean(name = "webService") WebService webService; </code></pre> <p>and my html page looks like:</p> <pre><code>&lt;a wicket:id="url"&gt;url&lt;/a&gt; &lt;p wicket:id="error"/&gt; </code></pre> <p>the problem is in html page that I have url or error and then wicket return exception: <code>Unable to find component with id 'error' in ...</code> how I can solve this problem</p>