Why I cannot instantiate this variable?
<p>I have this piece of code on a JSP file :</p>

<pre><code>// MainHomePage pageApp = new MainHomePage(session);

String pageValue=request.getParameter("page");
if((pageValue!=null) &amp;&amp; (pageValue.compareTo("1")==0)) {
    MainHomePage pageApp = new MainHomePage(session);
} else if((pageValue!=null) &amp;&amp; (pageValue.compareTo("2")==0)) {
    MainAffittaAppartamenti pageApp = new MainAffittaAppartamenti(session);
} else {
    MainHomePage pageApp = new MainHomePage(session);
}

pageApp.someMethod();
</code></pre>

<p>if i don't remove comment on the first line it said (about pageApp) "cannot find symbol"... why this? if-else will instantiate it, in any case. What am I wrong? Cheers</p>
