#188 Support jsp-file based servlets (patch)

pending
None
5
2012-09-13
2010-02-05
Rasmus Kaj
No

When parsing a web.xml containing a servlet that is based on a jsp-file rather than a servlet-class, both httpunit-1.7 and head from svn (as of today) throws a sax exception. I would like it to parse and correctly match such servlets. This functionality is implemented in the attached patch.

This is the first time i look at the httpunit source code, so be warned that the patch migth be ugly or possibly even break something.

Example of a traditionally supported servlet mapping:

<servlet>
<servlet-name>foo</servlet-name>
<servlet-class>my.package.FooServlet</servlet-class>
</servlet>

<servlet-mapping>
<servlet-name>foo</servlet-name>
<url-pattern>/foo</url-pattern>
</servlet-mapping>

Example of a mapping supported with the attached patch:

<servlet>
<servlet-name>bar</servlet-name>
<jsp-file>/somedir/bar.jsp</servlet-class>
</servlet>

<servlet-mapping>
<servlet-name>bar</servlet-name>
<url-pattern>/bar</url-pattern>
</servlet-mapping>

Discussion

  • Rasmus Kaj

    Rasmus Kaj - 2010-02-05

    Path implementing the requested feature

     
  • Wolfgang Fahl

    Wolfgang Fahl - 2012-09-13
    • assigned_to: nobody --> wolfgang_fahl
    • status: open --> pending
     
  • Wolfgang Fahl

    Wolfgang Fahl - 2012-09-13

    Dear httpunit user!

    Thank you for your feature request. We appreciate the time and effort you are putting into this.

    Please supply a testcase with the expected result for the feature you are asking for and we'll look into implementing it. For a start you might want to get the trunk version from the
    subversion repository (see https://sourceforge.net/svn/?group_id=6550\)
    and have a look at the source code of some of the more than 700 JUnit based testcase in there.

    When you are ready you might want to attach the testcase (and if you already have started implementing it also the actual code) to your feature request.

    This should give you a clue on what a proper testcase for httpunit looks like. The main communication about further details of the development is via the httpunit developer mailinglist. You are most welcome to sign up via
    https://lists.sourceforge.net/lists/listinfo/httpunit-develop

    Yours
    The httpunit developer team

    (Russell and Wolfgang as of 2008-03)

     
  • Wolfgang Fahl

    Wolfgang Fahl - 2012-09-13

    Dear Rasmus,

    thank you so much for your Feature Request including a patch. Since httpunit is strictly test-first you might want to:
    a) check that you patch does not brake anything e.g. by simply running mvn test
    agains the latest subversion revision including your patch
    b) add a test case for the behaviour you just added to make sure no one else will brake it later.

    I'll happily commit your changes thereafter.

    Keep up the good work!

    Yours
    Wolfgang

    P.S.: There is more information in the httpunit developer mailing list FAQ:
    https://sourceforge.net/mailarchive/forum.php?thread_name=4EEEE9F8.3040907%40bitplan.com&forum_name=httpunit-develop

     

Log in to post a comment.