File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
The moose likes Struts and the fly likes result display error Big Moose Saloon
  Search | Java FAQ | Recent Topics
Register / Login


Win a copy of The Mikado Method this week in the Agile and other Processes forum!
JavaRanch » Java Forums » Frameworks » Struts
Reply Bookmark "result display error" Watch "result display error" New topic
Author

result display error

Sweta Chauhan
Ranch Hand

Joined: Jul 09, 2010
Posts: 53
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

Bear Bibeault
Author and ninkuma
Marshal

Joined: Jan 10, 2002
Posts: 56185
    
  13

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


[Smart Questions] [JSP FAQ] [Books by Bear] [Bear's FrontMan] [About Bear]
Ankit Garg
Saloon Keeper

Joined: Aug 03, 2008
Posts: 9189
    
    2

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??


SCJP 6 | SCWCD 5 | Javaranch SCJP FAQ | SCWCD Links
Sweta Chauhan
Ranch Hand

Joined: Jul 09, 2010
Posts: 53
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

Joined: Jul 09, 2010
Posts: 53
Student.java

Ankit Garg
Saloon Keeper

Joined: Aug 03, 2008
Posts: 9189
    
    2

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

Joined: Jul 09, 2010
Posts: 53
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
Saloon Keeper

Joined: Aug 03, 2008
Posts: 9189
    
    2

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)...
 
I agree. Here's the link: http://zeroturnaround.com/jrebel - it saves me about five hours per week
 
subject: result display error
 
Similar Threads
Struts 2.1 Need two different success results
Unexpected error when running application from tomcat.
validation problem.
Struts2 Action Mapping Problem - No configuration found for the specified action
Problem in Struts Dispatcher