java - how to get object into jsp from arraylist which is added into modelAndView inside controller -
currently iam working on spring mvc. going transfer data controller view. have arraylist contain objects.it has been added modelandview inside controller can use jsp page.
model.addobject("results",results);
i want use values print table form not able so. doing this
${results.get(0).getparametername() }
but shows error
the function must used prefix when default namespace not specified
everything working fine. can me solve problem.
servlet.service() servlet spring-dispatcher threw exception org.apache.jasper.jasperexception: /web-inf/configureapplication.jsp(45,86) function must used prefix when default namespace not specified @ org.apache.jasper.compiler.defaulterrorhandler.jsperror(defaulterrorhandler.java:39) @ org.apache.jasper.compiler.errordispatcher.dispatch(errordispatcher.java:405) @ org.apache.jasper.compiler.errordispatcher.jsperror(errordispatcher.java:146) @ org.apache.jasper.compiler.validator$1fvvisitor.visit(validator.java:1243) @ org.apache.jasper.compiler.elnode$function.accept(elnode.java:122) @ org.apache.jasper.compiler.elnode$nodes.visit(elnode.java:193) @ org.apache.jasper.compiler.elnode$visitor.visit(elnode.java:234) @ org.apache.jasper.compiler.elnode$root.accept(elnode.java:53) @ org.apache.jasper.compiler.elnode$nodes.visit(elnode.java:193) @ org.apache.jasper.compiler.validator$validatevisitor.validatefunctions(validator.java:1266) @ org.apache.jasper.compiler.validator$validatevisitor.visit(validator.java:607) @ org.apache.jasper.compiler.node$elexpression.accept(node.java:896) @ org.apache.jasper.compiler.node$nodes.visit(node.java:2163) @ org.apache.jasper.compiler.node$visitor.visitbody(node.java:2213) @ org.apache.jasper.compiler.node$visitor.visit(node.java:2219) @ org.apache.jasper.compiler.node$root.accept(node.java:456) @ org.apache.jasper.compiler.node$nodes.visit(node.java:2163) @ org.apache.jasper.compiler.validator.validate(validator.java:1489) @ org.apache.jasper.compiler.compiler.generatejava(compiler.java:166) @ org.apache.jasper.compiler.compiler.compile(compiler.java:295) @ org.apache.jasper.compiler.compiler.compile(compiler.java:276) @ org.apache.jasper.compiler.compiler.compile(compiler.java:264) @ org.apache.jasper.jspcompilationcontext.compile(jspcompilationcontext.java:563) @ org.apache.jasper.servlet.jspservletwrapper.service(jspservletwrapper.java:303) @ org.apache.jasper.servlet.jspservlet.servicejspfile(jspservlet.java:314) @ org.apache.jasper.servlet.jspservlet.service(jspservlet.java:264) @ javax.servlet.http.httpservlet.service(httpservlet.java:820) @ org.apache.catalina.core.applicationfilterchain.internaldofilter(applicationfilterchain.java:290) @ org.apache.catalina.core.applicationfilterchain.dofilter(applicationfilterchain.java:206) @ org.apache.catalina.core.applicationdispatcher.invoke(applicationdispatcher.java:646) @ org.apache.catalina.core.applicationdispatcher.processrequest(applicationdispatcher.java:436) @ org.apache.catalina.core.applicationdispatcher.doforward(applicationdispatcher.java:374) @ org.apache.catalina.core.applicationdispatcher.forward(applicationdispatcher.java:302) @ org.springframework.web.servlet.view.internalresourceview.rendermergedoutputmodel(internalresourceview.java:209) @ org.springframework.web.servlet.view.abstractview.render(abstractview.java:267) @ org.springframework.web.servlet.dispatcherservlet.render(dispatcherservlet.java:1221) @ org.springframework.web.servlet.dispatcherservlet.processdispatchresult(dispatcherservlet.java:1005) @ org.springframework.web.servlet.dispatcherservlet.dodispatch(dispatcherservlet.java:952) @ org.springframework.web.servlet.dispatcherservlet.doservice(dispatcherservlet.java:870) @ org.springframework.web.servlet.frameworkservlet.processrequest(frameworkservlet.java:961) @ org.springframework.web.servlet.frameworkservlet.doget(frameworkservlet.java:852) @ javax.servlet.http.httpservlet.service(httpservlet.java:707) @ org.springframework.web.servlet.frameworkservlet.service(frameworkservlet.java:837) @ javax.servlet.http.httpservlet.service(httpservlet.java:820) @ org.apache.catalina.core.applicationfilterchain.internaldofilter(applicationfilterchain.java:290) @ org.apache.catalina.core.applicationfilterchain.dofilter(applicationfilterchain.java:206) @ org.apache.catalina.core.standardwrappervalve.invoke(standardwrappervalve.java:233) @ org.apache.catalina.core.standardcontextvalve.invoke(standardcontextvalve.java:191) @ org.apache.catalina.core.standardhostvalve.invoke(standardhostvalve.java:128) @ org.apache.catalina.valves.errorreportvalve.invoke(errorreportvalve.java:102) @ org.apache.catalina.core.standardenginevalve.invoke(standardenginevalve.java:109) @ org.apache.catalina.connector.coyoteadapter.service(coyoteadapter.java:293) @ org.apache.coyote.http11.http11processor.process(http11processor.java:849) @ org.apache.coyote.http11.http11protocol$http11connectionhandler.process(http11protocol.java:583) @ org.apache.tomcat.util.net.jioendpoint$worker.run(jioendpoint.java:454) @ java.lang.thread.run(thread.java:722)
the term in ${...}
in jsp expression language , not java. members of list
can accessed members of array , bean properties name. hence should try:
${results[0].parametername}
Comments
Post a Comment