I am trying to use below code to instantiate a Integer variable but I keep getting error like java.lang.InstantiationException: Not defined beanName or class!
<jsp:useBean id="selectedID" scope="session" type="java.lang.Integer" />
I am not sure but this piece of code used to work in JDK 1.4 but in JDK 1.6 it's throwing exception. Is there any other way to instantiate a Integer variable in JSP?
I tried using class="java.lang.Integer" but it didn't work because Integer wrapper doesn't have a no-arg constructor. I also tried below code but it reset the value during the runtime.
<% java.lang.Integer selectedID; %>
selectedID is used in JSP within Java blocks: switch (selectedID.intValue())
selectedID is set somewhere in a java class in a session. The set value is then used in JSP to render specific interface. All I need is to instantiate (not initialized) the variable in JSP.
Any inputs will be appreciated.