• 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

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

 
Ranch Hand
Posts: 466
1
IntelliJ IDE Oracle Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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 Oracle Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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.
 
With a little knowledge, a cast iron skillet is non-stick and lasts a lifetime.
reply
    Bookmark Topic Watch Topic
  • New Topic