This week's book giveaways are in the Refactoring and Agile forums.
We're giving away four copies each of Re-engineering Legacy Software and Docker in Action and have the authors on-line!
See this thread and this one for details.
Win a copy of Re-engineering Legacy Software this week in the Refactoring forum
or Docker in Action in the Agile forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

500 Internal Server Error with passing wrong parameter in action of struts 2.0

 
yatin baraiya
Ranch Hand
Posts: 30
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
hi all

my working environment is below
jsp,struts 2.0,java ,I will also use the interceptor

My issue is that when i fire below url in browser

here i inform that Id is integer type variable in my struts action class.

https://test123.local.com/test123/test.action?id=9

it works fine

but when i fire the same url with updating 9 to 9'

https://test123.local.com/test123/test.action?id=9'

give me the following exception in console and nothing will be displayed in the browser.

SEVERE: Servlet.service() for servlet default threw exception Infinite recursion detected:

and as per checking in FF fire-burg tool display me the 500 Internal Server Error.

anybody have idea ,how do i prevent this type of error, I need to catch this error in exception and want to redirect the users to access restricted page.

And one more point i want something generic solutions for it, not wan to specific solutions for it.

Let me know if you wan to any other information

Thanks & Regards
Yatin Baraiya

 
yatin baraiya
Ranch Hand
Posts: 30
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
hi all

here i have also mentioned with the more detail for the above issue.

as per the below given url

https://test123.local.com/test123/test.action?id=9'

my struts-admin.xml entry as like below




So here my customStack interceptor call first




as per debugging the above code i found that my interceptor will not call my "handled" name action and throws the exception as per given below:

Infinite recursion detected: [//test!test, //handled, //handled] - [unknown location]
at com.opensymphony.xwork2.ActionChainResult.execute(ActionChainResult.java:207)
at com.opensymphony.xwork2.DefaultActionInvocation.executeResult(DefaultActionInvocation.java:348)
at com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:253)

let me know if you want to other information
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic