Code: Select all
<jsp:useBean id="myint" class="java.lang.Integer" />
Moderator: admin
Code: Select all
<jsp:useBean id="myint" class="java.lang.Integer" />
Code: Select all
<jsp:useBean id="myint" class="java.lang.Integer"/>
<%=myint%>
According to this, it really seems like "it will not compile" is the correct answer, perhaps the compiler is clever enough to find out that java.lang.Integer cannot be instantiated without arguments.Jun 11, 2013 5:43:59 PM org.apache.catalina.core.StandardWrapperValve invoke
SEVERE: Servlet.service() for servlet jsp threw exception
org.apache.jasper.JasperException: /testUseBean.jsp(1,1) The value for the useBean class attribute java.lang.Integer is invalid.
at org.apache.jasper.compiler.DefaultErrorHandler.jspError(DefaultErrorHandler.java:40)
at org.apache.jasper.compiler.ErrorDispatcher.dispatch(ErrorDispatcher.java:407)
at org.apache.jasper.compiler.ErrorDispatcher.jspError(ErrorDispatcher.java:148)
at org.apache.jasper.compiler.Generator$GenerateVisitor.visit(Generator.java:1231)
at org.apache.jasper.compiler.Node$UseBean.accept(Node.java:1178)
at org.apache.jasper.compiler.Node$Nodes.visit(Node.java:2361)
at org.apache.jasper.compiler.Node$Visitor.visitBody(Node.java:2411)
...
Users browsing this forum: No registered users and 23 guests