Issue: compilation error vs runtime error
<
jsp:useBean id="intBean" class="java.lang.Integer" />
<jsp:setProperty name="intBean" property="*"/>
<%=intBean%>
When we use the class as
java.lang.Integer it would throws an
Instantiation Exception
However, if we use <jsp:useBean id="intBean" class="
com.myclass" /> such that
public class myclass{
myclass(int a){} //parametrized constructor
private int intBean;
//getter + setter of intBean
}
Then the <jsp:useBean would cause a
compilation error.
Could anyone suggest the possible reason behind this?