Servlet Help

> Harihara Vinayak Ram writes:
>  > Hi,
>  > 	I have been trying to get Servlets running under Jigsaw. I wrote a
>  > resource which extends ServletWrapper and tried setting its servlet-class
>  > Attributes to the actual servlet.
> 
> Are you sure you need to extend ServletWrapper ? 
	I am not sure. But my understanding on reading the documentation was
that this is the only way I can run Servlets under Jigsaw. Is there any other
way of doing this...
> 
>  > 	When I check the Attributes of the resource I do not find the name
>  > of servlet-class Attribute set.
> 
> Hum that's weird, may be having a look at your code would help,
> 
>  > 	Is there anything that I am doing wrong here. Does Jigsaw support 
>  > Servlets and if so which version of Servlets ( The version of Servlets
>  > with JeevesA2 or JavaServerBeta ).
> 
> The JeevesA2 one, next release will suport the JavaServerBeta
> 
> Anselm.
> 
I am sending the code across.. 

package ServletTest;

import java.servlet.*;
// import java.servlet.html.*;
import java.io.*;

import w3c.www.http.*;
import w3c.www.mime.*;
import w3c.jigsaw.http.*;
import w3c.jigsaw.resources.*;
import w3c.jigsaw.servlet.*;
import w3c.jigsaw.forms.*;
import w3c.tools.store.*;

public class Test1 extends ServletWrapper {

	static protected int ATTR_MESSAGE = -1 ;
	static protected int ATTR_PARAM = -1 ;

	static {
		Attribute a = null;
		Class cls = null;

		try
		{
			cls = Class.forName("ServletTest.Test1");
		} catch (Exception e)
		{
			e.printStackTrace();
			System.exit(1);
		}

		a = new StringAttribute("servlet-class", 
					"ServletTest.Test2", 
					 Attribute.EDITABLE);
		ATTR_MESSAGE = AttributeRegistry.registerAttribute(cls,a);

		a = new PropertiesAttribute("param",
                   		            "My Name",
					    1 );
		ATTR_PARAM = AttributeRegistry.registerAttribute(cls,a);
	}

}

Received on Wednesday, 26 March 1997 05:28:50 UTC