• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

StrutsTestCase Exception - Not reading few <init-param> parameters in web.xml

 
Vinod Tiwari
Ranch Hand
Posts: 466
1
IntelliJ IDE Java Oracle
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I'm using StrutsTestCase for unit testing my code but I'm getting javax.servlet.ServletException: init parameter struts-filter-config not set in web.xml exception whilst running my test case.

Initially Test Class was not reading web.xml file but after setting context directory in setup() that issue is resolved.



The code snippet of web.xml where the issue is occuring is as under:



There is velicity related servlet defined above this servlet and its working fine. The code is giving same error even if I remove all <init-param> in above class. Unfortunately I cannot share the code due to organisational directives. Pointers in resolving the issue would be appreciated.
 
Vinod Tiwari
Ranch Hand
Posts: 466
1
IntelliJ IDE Java Oracle
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Issue resolved, there is setInitParameter(java.lang.String key, java.lang.String value) method in MockStrutsTestCase class using which Init Params can be set.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic