File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Question about setting up Cactus for JSP Testing

 
Samarth Kumar
Greenhorn
Posts: 12
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Folks,

I am using Cactus to unit test servlets and jsps. My configuration of Cactus is as follows:

cactus.properties

cactus.contextURL = http://localhost:9081/contextRoot

no other entries in this file. I am using the default ServletRedirector and ServletTestRunner.

I am now trying to test custom tags that extend JspTestCase. Accordingly, I added the entries for the JspRedirector to the web.xml file. The entries are as follows:

web.xml

<servlet>
<servlet-name>JspRedirector</servlet-name>
<servlet-class>/jspRedirector.jsp</servlet-class>
</servlet>
<servlet-mapping>
<servlet-name>JspRedirector</servlet-name>
<url-pattern>/JspRedirector</url-pattern>
</servlet-mapping>

The jspRedirector.jsp is located in the WEB-INF directory of the web application.

On trying to run the test by invoking the following url, I get the error message below:

Error 500: Missing service name parameter [Cactus_Service] in HTTP request. Received query string is [null].

The url used is:

http://localhost:9081/contextRoot/jspRedirector.jsp

Any pointers on what I am doing incorrectly.

Thanks,
Samarth
 
I agree. Here's the link: http://aspose.com/file-tools
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic