Re: getNamedDispatcher and named JSP pages

Wolfgang Fahl <[email protected]> Fri, 07 May 2010 14:00:24 +0200
Newsgroups gmane.comp.web.httpunit.devel
Organization BITPlan GmbH
Message-ID <[email protected]>
This is a multi-part message in MIME format.
--===============4566917032793190929==
Content-Type: multipart/alternative;
	boundary="------------070501090101070809050306"

This is a multi-part message in MIME format.
--------------070501090101070809050306
Content-Type: text/plain; charset=ISO-8859-1; format=flowed
Content-Transfer-Encoding: 8bit

Izzy,

thank you for this patch. Subversion revision 1066 has your patch (at 
least so I hope). I was not able to get a proper JUnit test coded and 
working
for this. Since your patch did not break any other test i have still 
submitted it. Would you please have a look at revision 1066 and let me 
know what needs to be fixed to get things working the way you expected it?

Yours
   wolfgang
Am 28.12.09 16:17, schrieb Izzy Alanis:
> I needed to unit test an app that used getNamedDispatcher to reference
> a named jsp page. So, the servlet does something like:
>
>       RequestDispatcher errorPage =
> getServletContext().getNamedDispatcher("errorPage");
>       errorPage.forward(request, response);
>
> Where "errorPage" is defined in the web.xml as:
>
>    <servlet>
>      <servlet-name>errorPage</servlet-name>
>      <display-name>Generic Error Page</display-name>
>      <jsp-file>/errorPage.jsp</jsp-file>
>    </servlet>
>
> Anyway, I've used httpunit before and am happy with it, but I was
> surprised to find that getNamedDispatcher wasn't implemented, so I
> patched up something quick to make it work (for me, ymmv).
>
>      http://pastebin.com/f15093292
>    
>
>
> ------------------------------------------------------------------------------
> This SF.Net email is sponsored by the Verizon Developer Community
> Take advantage of Verizon's best-in-class app development support
> A streamlined, 14 day to market process makes app distribution fast and easy
> Join now and get one step closer to millions of Verizon customers
> http://p.sf.net/sfu/verizon-dev2dev
>
>
> _______________________________________________
> Httpunit-develop mailing list
> [email protected]
> https://lists.sourceforge.net/lists/listinfo/httpunit-develop
>    


-- 

BITPlan - smart solutions
Wolfgang Fahl
Pater-Delp-Str. 1, D-47877 Willich Schiefbahn
Tel. +49 2154 811-480, Fax +49 2154 811-481
Web: http://www.bitplan.de
BITPlan GmbH, Willich - HRB 6820 Krefeld, Steuer-Nr.: 10258040548, Geschäftsführer: Wolfgang Fahl


--------------070501090101070809050306
Content-Type: text/html; charset=ISO-8859-1
Content-Transfer-Encoding: 7bit

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
  <meta content="text/html; charset=ISO-8859-1"
 http-equiv="Content-Type">
</head>
<body bgcolor="#ffffff" text="#000000">
Izzy,<br>
<br>
thank you for this patch. Subversion revision 1066 has your patch (at
least so I hope). I was not able to get a proper JUnit test coded and
working<br>
for this. Since your patch did not break any other test i have still
submitted it. Would you please have a look at revision 1066 and let me
know what needs to be fixed to get things working the way you expected
it?<br>
<br>
Yours<br>
&nbsp; wolfgang<br>
Am 28.12.09 16:17, schrieb Izzy Alanis:
<blockquote
 cite="mid:[email protected]"
 type="cite">
  <pre wrap="">I needed to unit test an app that used getNamedDispatcher to reference
a named jsp page. So, the servlet does something like:

     RequestDispatcher errorPage =
getServletContext().getNamedDispatcher("errorPage");
     errorPage.forward(request, response);

Where "errorPage" is defined in the web.xml as:

  &lt;servlet&gt;
    &lt;servlet-name&gt;errorPage&lt;/servlet-name&gt;
    &lt;display-name&gt;Generic Error Page&lt;/display-name&gt;
    &lt;jsp-file&gt;/errorPage.jsp&lt;/jsp-file&gt;
  &lt;/servlet&gt;

Anyway, I've used httpunit before and am happy with it, but I was
surprised to find that getNamedDispatcher wasn't implemented, so I
patched up something quick to make it work (for me, ymmv).

    <a class="moz-txt-link-freetext" href="http://pastebin.com/f15093292">http://pastebin.com/f15093292</a>
  </pre>
  <pre wrap="">
<fieldset class="mimeAttachmentHeader"></fieldset>
------------------------------------------------------------------------------
This SF.Net email is sponsored by the Verizon Developer Community
Take advantage of Verizon's best-in-class app development support
A streamlined, 14 day to market process makes app distribution fast and easy
Join now and get one step closer to millions of Verizon customers
<a class="moz-txt-link-freetext" href="http://p.sf.net/sfu/verizon-dev2dev">http://p.sf.net/sfu/verizon-dev2dev</a> </pre>
  <pre wrap="">
<fieldset class="mimeAttachmentHeader"></fieldset>
_______________________________________________
Httpunit-develop mailing list
<a class="moz-txt-link-abbreviated" href="mailto:[email protected]">[email protected]</a>
<a class="moz-txt-link-freetext" href="https://lists.sourceforge.net/lists/listinfo/httpunit-develop">https://lists.sourceforge.net/lists/listinfo/httpunit-develop</a>
  </pre>
</blockquote>
<br>
<br>
<pre class="moz-signature" cols="72">-- 

BITPlan - smart solutions
Wolfgang Fahl
Pater-Delp-Str. 1, D-47877 Willich Schiefbahn
Tel. +49 2154 811-480, Fax +49 2154 811-481
Web: <a class="moz-txt-link-freetext" href="http://www.bitplan.de">http://www.bitplan.de</a>
BITPlan GmbH, Willich - HRB 6820 Krefeld, Steuer-Nr.: 10258040548, Gesch&auml;ftsf&uuml;hrer: Wolfgang Fahl </pre>
</body>
</html>

--------------070501090101070809050306--


--===============4566917032793190929==
Content-Type: text/plain; charset="us-ascii"
MIME-Version: 1.0
Content-Transfer-Encoding: 7bit
Content-Disposition: inline

------------------------------------------------------------------------------


--===============4566917032793190929==
Content-Type: text/plain; charset="us-ascii"
MIME-Version: 1.0
Content-Transfer-Encoding: 7bit
Content-Disposition: inline

_______________________________________________
Httpunit-develop mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/httpunit-develop

--===============4566917032793190929==--