• 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
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

result display error

 
Ranch Hand
Posts: 57
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I am trying to display list of data from database in struts2, I have defined the success result but when try to call the action it throw error

I don't have requirement for input result. Any one have faced this kind of problem then please help me out. Why is it so?
Below is the action mapping in struts.xml file

 
Sheriff
Posts: 67746
173
Mac Mac OS X IntelliJ IDE jQuery TypeScript Java iOS
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Please be sure to ask Struts questions in the Struts forum. I have moved this post there for you.
 
Sheriff
Posts: 9707
43
Android Google Web Toolkit Hibernate IntelliJ IDE Spring Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Its hard to guess what the problem is without some more code. Does your action returns "input" result in any way or is there any validation error when you reach this action??
 
Sweta Chauhan
Ranch Hand
Posts: 57
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

Ankit Garg wrote:Its hard to guess what the problem is without some more code. Does your action returns "input" result in any way or is there any validation error when you reach this action??




All files are given below:
struts.xml


viewStudent.jsp



StudentAction.java


StudentAction-validation.xml


 
Sweta Chauhan
Ranch Hand
Posts: 57
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Student.java

 
Ankit Garg
Sheriff
Posts: 9707
43
Android Google Web Toolkit Hibernate IntelliJ IDE Spring Java
  • Likes 1
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
When does the error appear actually?? If it occurs when you enter a URL into the browser, then tell us that URL otherwise if it happens when you submit a form, then please post the code of that form. I think the error appears when you try to list all students as validation happens in that case and since there is no "input" result defined, you get the 404 error message. You'll have to tell struts to skip validation in case of StudentAction.list() method. You can find more info on how to do that here...
 
Sweta Chauhan
Ranch Hand
Posts: 57
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

Ankit Garg wrote:When does the error appear actually?? If it occurs when you enter a URL into the browser, then tell us that URL otherwise if it happens when you submit a form, then please post the code of that form. I think the error appears when you try to list all students as validation happens in that case and since there is no "input" result defined, you get the 404 error message. You'll have to tell struts to skip validation in case of StudentAction.list() method. You can find more info on how to do that here...



Thanks by use of interceptor for list action it work perfectly.
 
Ankit Garg
Sheriff
Posts: 9707
43
Android Google Web Toolkit Hibernate IntelliJ IDE Spring Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
basicStackHibernate doesn't have validation interceptor in it. If you had used the struts basicStack in your action that would've worked too (or the solution that I gave you earlier)...
 
You didn't tell me he was so big. Unlike this tiny ad:
a bit of art, as a gift, the permaculture playing cards
https://gardener-gift.com
reply
    Bookmark Topic Watch Topic
  • New Topic