• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Ron McLeod
  • Paul Clapham
  • Tim Cooke
  • Devaka Cooray
Sheriffs:
  • Liutauras Vilda
  • paul wheaton
  • Rob Spoor
Saloon Keepers:
  • Tim Moores
  • Stephan van Hulst
  • Tim Holloway
  • Piet Souris
  • Mikalai Zaikin
Bartenders:
  • Carey Brown
  • Roland Mueller

Issue with Vaanilla Struts 2/Hibernate CRUD example

 
Greenhorn
Posts: 2
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hello all,

I have been trying to build a struts 2/hibernate web application that is based off of this example:
http://www.vaannila.com/struts-2/struts-2-example/struts-2-crud-example-1.html

My problem is this same as this thread, but the solutions there did not work for me:
https://coderanch.com/t/528498/Struts/Struts-valuestack-error

I've been stuck on this for several days. Here are the different classes/config files/jsp of my code:

The model class: Dnis.java



The Controllers: DnisDAO.java & DnisDAOImpl.java





The Action class: DnisAction.java



The struts.xml



And finally the Jsp: index.jsp



I try and run the application and it gives me this stack trace:

  • SEVERE: Servlet.service() for servlet [jsp] in context with path [/IVRSupportv1.1] threw exception [tag 'push', field 'value': You must specify a value to push on the stack. Example: person - [unknown location]] with root cause
    tag 'push', field 'value': You must specify a value to push on the stack. Example: person - [unknown location]
    at org.apache.struts2.components.Component.fieldError(Component.java:230)
    at org.apache.struts2.components.Component.findValue(Component.java:351)
    at org.apache.struts2.components.Push.start(Push.java:128)
    at org.apache.struts2.views.jsp.ComponentTagSupport.doStartTag(ComponentTagSupport.java:53)
    at org.apache.jsp.index_jsp._jspx_meth_s_005fpush_005f0(index_jsp.java:183)
    at org.apache.jsp.index_jsp._jspx_meth_s_005fform_005f0(index_jsp.java:152)
    at org.apache.jsp.index_jsp._jspService(index_jsp.java:108)
    at org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:70)
    at javax.servlet.http.HttpServlet.service(HttpServlet.java:722)
    at org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:433)
    at org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:389)
    at org.apache.jasper.servlet.JspServlet.service(JspServlet.java:333)
    at javax.servlet.http.HttpServlet.service(HttpServlet.java:722)
    at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:304)
    at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:210)
    at org.apache.struts2.dispatcher.ng.filter.StrutsPrepareAndExecuteFilter.doFilter(StrutsPrepareAndExecuteFilter.java:73)
    at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:243)
    at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:210)
    at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:224)
    at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:185)
    at org.apache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBase.java:472)
    at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:151)
    at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:100)
    at org.apache.catalina.valves.AccessLogValve.invoke(AccessLogValve.java:929)
    at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:118)
    at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:405)
    at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:269)
    at org.apache.coyote.AbstractProtocol$AbstractConnectionHandler.process(AbstractProtocol.java:515)
    at org.apache.tomcat.util.net.JIoEndpoint$SocketProcessor.run(JIoEndpoint.java:300)
    at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1110)
    at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:603)
    at java.lang.Thread.run(Thread.java:722)


  • Thanks for the help!!!
     
    Bartender
    Posts: 9626
    16
    Mac OS X Linux Windows
    • Mark post as helpful
    • send pies
      Number of slices to send:
      Optional 'thank-you' note:
    • Quote
    • Report post to moderator
    Looking at this error:

    tag 'push', field 'value': You must specify a value to push on the stack. Example: person - [unknown location]


    and the push tag documentation, my guess would be that a textfield tag is not a value and can't be pushed on the stack.
     
    Sean Romocki
    Greenhorn
    Posts: 2
    • Mark post as helpful
    • send pies
      Number of slices to send:
      Optional 'thank-you' note:
    • Quote
    • Report post to moderator
    Hey Joe,

    Thanks for your response. I looked again at the Vaanilla exmaple and they used a textfield as part of the value in their example. The actual value is "value = user" in their example, or in my case "value = dnis" which is the Dnis.java object and the textfield names are the different fields. But anyways, maybe if I clarify how I want this page setup it will be easier for you to help me. These have to be textfields because they have to be user inputs.

    This .jsp page should have all the input text boxes for the addition of a Dnis object to the database at the top. Right below all the input fields is a submit button. Below that is the list of all the current records in the database. When I add a record the list should refresh with the new record included. If I click edit, the values of that object should be populated into the textfields. Now, when I click submit the record's info will be updated in the database and the list. I was thinking maybe there is a disconnect between the clicking the edit button and having those values populate the above textfields. But how do I make that linkage? I know this is super simple, but have pity for I'm just a humble greenhorn. Thanks for you help!
     
    So I left, I came home, and I ate some pie. And then I read this tiny ad:
    We need your help - Coderanch server fundraiser
    https://coderanch.com/wiki/782867/Coderanch-server-fundraiser
    reply
      Bookmark Topic Watch Topic
    • New Topic