Hi Hugo,

Your servlet needs to define what mime type it returns with :

        response.setContentType("text/html");

-Vincent

> -----Original Message-----
> From: Hugo A. Garcia [mailto:[EMAIL PROTECTED]]
> Sent: 08 July 2002 14:26
> To: [EMAIL PROTECTED]
> Subject: Testing Meta Tags
> 
> 
> Hi
> 
> I am using cactus and I am trying to test a meta tag BUT I continously
> get a false for isHtml() or an execpection telling me that the content
> is not text/html but text/plain.
> 
> How do i test meta tags?
> 
> here is the code...
> 
> import javax.servlet.*;
> import javax.servlet.http.*;
> import org.apache.cactus.*;
> import junit.framework.*;
> 
> /**
>  * @author Hugo A. Garcia
>  * Jul 8, 2002
>  **/
> public class SimpleTest extends ServletTestCase {
> 
>         /**
>          * Constructor for SimpleTest.
>          * @param arg0
>          */
>         public SimpleTest(String arg0) {
>                 super(arg0);
>         }
> 
>         public void testSendParams() {
>                 Browse servlet = (Browse)
WikiStrategy.create("Browse");
> 
>         }
> 
>         public void endSendParams(com.meterware.httpunit.WebResponse
> aWebResponse) {
> 
>                 assertTrue(aWebResponse.isHTML());
> 
>                 /*
>                 try {
> 
>                         String[] commandAttribute = null;
>                         commandAttribute =
> aWebResponse.getMetaTagContent("name", "command");
>                         assertEquals("Browse", commandAttribute[0]);
>                 } catch (SAXException e) {
>                         e.printStackTrace();
>                 }
>                 */
>         }
> }
> 
> 
> -------------
> 
> import javax.servlet.*;
> import javax.servlet.http.*;
> import org.apache.cactus.*;
> import junit.framework.*;
> 
> /**
>  * @author Hugo A. Garcia
>  * Jul 8, 2002
>  **/
> public class SimpleTest extends ServletTestCase {
> 
>         /**
>          * Constructor for SimpleTest.
>          * @param arg0
>          */
>         public SimpleTest(String arg0) {
>                 super(arg0);
>         }
> 
>         public void testSendParams() {
>                 Simple servlet = new Simple();
>         }
> 
>         public void endSendParams(com.meterware.httpunit.WebResponse
> aWebResponse) {
> 
>                 assertTrue(aWebResponse.isHTML());
> 
>                 /*
>                 try {
> 
>                         String[] commandAttribute = null;
>                         commandAttribute =
> aWebResponse.getMetaTagContent("name", "command");
>                         assertEquals("Browse", commandAttribute[0]);
>                 } catch (SAXException e) {
>                         e.printStackTrace();
>                 }
>                 */
>         }
> }
> 
> 
> --
> To unsubscribe, e-mail:   <mailto:cactus-user-
> [EMAIL PROTECTED]>
> For additional commands, e-mail: <mailto:cactus-user-
> [EMAIL PROTECTED]>



--
To unsubscribe, e-mail:   <mailto:[EMAIL PROTECTED]>
For additional commands, e-mail: <mailto:[EMAIL PROTECTED]>

Reply via email to