wood burning stoves 2.0*
The moose likes Struts and the fly likes Unable to display the Data from SQL SERVER 2005 on  a JSP through <c:forEach> tags Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Frameworks » Struts
Bookmark "Unable to display the Data from SQL SERVER 2005 on  a JSP through <c:forEach> tags" Watch "Unable to display the Data from SQL SERVER 2005 on  a JSP through <c:forEach> tags" New topic
Author

Unable to display the Data from SQL SERVER 2005 on a JSP through <c:forEach> tags

Vinod Vinu
Ranch Hand

Joined: Aug 30, 2009
Posts: 217
Hi....iam using ActionForm(form bean)(RegForm.java) and ActionClass(SelectAction.java) where iam retrieving data in array list through Hibernate.
Iam using <c:forEach> </c:forEach> on a JSP called registeration.jsp and trying to display the data.
But it is not happening, since iam getting error while using <c:forEach>

Following is error:-

SEVERE: Servlet.service() for servlet action threw exception
org.apache.jasper.JasperException: /WEB-INF/jsp/registeration.jsp(90,7) According to TLD or attribute directive in tag file, attribute items does not accept any expressions
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.Validator$ValidateVisitor.checkXmlAttributes(Validator.java:952)
at org.apache.jasper.compiler.Validator$ValidateVisitor.visit(Validator.java:706)
at org.apache.jasper.compiler.Node$CustomTag.accept(Node.java:1442)
at org.apache.jasper.compiler.Node$Nodes.visit(Node.java:2166)
at org.apache.jasper.compiler.Node$Visitor.visitBody(Node.java:2216)
at org.apache.jasper.compiler.Validator$ValidateVisitor.visit(Validator.java:726)
at org.apache.jasper.compiler.Node$CustomTag.accept(Node.java:1442)
at org.apache.jasper.compiler.Node$Nodes.visit(Node.java:2166)
at org.apache.jasper.compiler.Node$Visitor.visitBody(Node.java:2216)
at org.apache.jasper.compiler.Validator$ValidateVisitor.visit(Validator.java:726)
at org.apache.jasper.compiler.Node$CustomTag.accept(Node.java:1442)
at org.apache.jasper.compiler.Node$Nodes.visit(Node.java:2166)
at org.apache.jasper.compiler.Node$Visitor.visitBody(Node.java:2216)
at org.apache.jasper.compiler.Node$Visitor.visit(Node.java:2222)
at org.apache.jasper.compiler.Node$Root.accept(Node.java:457)
at org.apache.jasper.compiler.Node$Nodes.visit(Node.java:2166)
at org.apache.jasper.compiler.Validator.validate(Validator.java:1484)
at org.apache.jasper.compiler.Compiler.generateJava(Compiler.java:167)
at org.apache.jasper.compiler.Compiler.compile(Compiler.java:296)
at org.apache.jasper.compiler.Compiler.compile(Compiler.java:277)
at org.apache.jasper.compiler.Compiler.compile(Compiler.java:265)
at org.apache.jasper.JspCompilationContext.compile(JspCompilationContext.java:564)
at org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:302)
at org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:329)
at org.apache.jasper.servlet.JspServlet.service(JspServlet.java:265)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:803)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:269)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:188)
at org.apache.catalina.core.ApplicationDispatcher.invoke(ApplicationDispatcher.java:679)
at org.apache.catalina.core.ApplicationDispatcher.processRequest(ApplicationDispatcher.java:461)
at org.apache.catalina.core.ApplicationDispatcher.doForward(ApplicationDispatcher.java:399)
at org.apache.catalina.core.ApplicationDispatcher.forward(ApplicationDispatcher.java:301)
at org.apache.struts.action.RequestProcessor.doForward(RequestProcessor.java:1056)
at org.apache.struts.action.RequestProcessor.internalModuleRelativeForward(RequestProcessor.java:994)
at org.apache.struts.action.RequestProcessor.processForward(RequestProcessor.java:553)
at org.apache.struts.action.RequestProcessor.process(RequestProcessor.java:211)
at org.apache.struts.action.ActionServlet.process(ActionServlet.java:1164)
at org.apache.struts.action.ActionServlet.doGet(ActionServlet.java:397)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:690)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:803)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:269)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:188)
at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:213)
at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:174)
at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:127)
at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:117)
at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:108)
at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:174)
at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:874)
at org.apache.coyote.http11.Http11BaseProtocol$Http11ConnectionHandler.processConnection(Http11BaseProtocol.java:665)
at org.apache.tomcat.util.net.PoolTcpEndpoint.processSocket(PoolTcpEndpoint.java:528)
at org.apache.tomcat.util.net.LeaderFollowerWorkerThread.runIt(LeaderFollowerWorkerThread.java:81)
at org.apache.tomcat.util.threads.ThreadPool$ControlRunnable.run(ThreadPool.java:689)
at java.lang.Thread.run(Thread.java:595)


Registeration.jsp : -


RegForm.java : -


SelectAction.java:-



Please help me sort out this issue.
Thank you in advance


Vinod Kumar Nair
"Any fool can write code that a computer can understan. Good programmers write code that humans can understand."
rahul khanna
Ranch Hand

Joined: Sep 14, 2005
Posts: 48
Instead of doing RegForm.employeeList.. put the list in session and then retrieve the list from the session on the page.

something like items=sessionScope.YourListName

once iternated, you can also remove the list from the session using jstl.

Hope it helps.
Bear Bibeault
Author and ninkuma
Marshal

Joined: Jan 10, 2002
Posts: 60780
    
  65

Please be sure to ask Struts questions in the Struts forum. I have moved this post there for you.


[Asking smart questions] [Bear's FrontMan] [About Bear] [Books by Bear]
 
jQuery in Action, 2nd edition
 
subject: Unable to display the Data from SQL SERVER 2005 on a JSP through <c:forEach> tags
 
Similar Threads
Unable to fetch data on a specific JSP....getting error "HTTP Status 404 - /getData.do"... help.
Verification failed on Username existence check using AJAX
Fusion Charts: How to put data into xml file ?
JasperException with RSS and JSTL
Model driven validation