Hi
The code is pasted below
I have removed the SingleThreadModel
The project is actually a COM server which is wrapped using the JInterga
tool which gives me the Java Classes , these classes are called by my
servlet , the Vc++ client invokes the Servlet using the Http request, which
will be handled accordingly,
The only problem is it doesn't support multiple client, else it works fine
You can go through the code
I have made the method as synchronized for handling the client
simultaneously one after the other
package sunexamples;
import javax.servlet.*;
import javax.servlet.http.*;
import java.io.*;
import nartry.*;
public class imgsearch2 extends HttpServlet
{
PrintWriter out=null;
public void service(HttpServletRequest req, HttpServletResponse res)
throws ServletException, IOException
{
synchronized(this)
{
new media(req,res,out);
}
}//service ends here
class media
{
public media(HttpServletRequest req, HttpServletResponse res,PrintWriter
out) throws ServletException, IOException
{
String sum="";
String data="";
String sum1="";
String output="";
String s2[]=new String[1];
String s3[];
String s4[];
Object s[]=new Object[1];
Object s1[]=new Object[1];
boolean bl[]=new boolean[1];
boolean success1[]=new boolean[1];
out=res.getWriter();
try{
nartry.mediasearch ms=new nartry.mediasearch();
InputStream in=req.getInputStream();
DataInputStream result=new DataInputStream(new BufferedInputStream(in));
int d=0;
while((data=result.readLine())!=null)
{
if(d==0)
sum=data;
else
sum1=data;
d++;
}
boolean b=ms.imgsearch(sum,sum1,s2,s,bl) ;
s3=(String[])s[0];
if((String[])s[0]!=null)
{
for(int t=0;t<s2.length;t++)
{
output=s2[t]+"#";
}
for(int t=1;t<s3.length;t++)
{
out.println(s3[t]);
if(t==(s3.length-1))
{
output+=s3[t]+"#"+b+"#"+bl[0];
out.println(output);
output="";
}
else
{
output+=s3[t]+"$";
}
}
}
else
{
out.println(bl[0]+"#"+b);
}
}catch(Exception e){out.println(e);}
}//constructor media ends
}// class media ends here
}main class ends here
waiting for your reply
Sachin
___________________________________________________________________________
To unsubscribe, send email to [EMAIL PROTECTED] and include in the body
of the message "signoff SERVLET-INTEREST".
Archives: http://archives.java.sun.com/archives/servlet-interest.html
Resources: http://java.sun.com/products/servlet/external-resources.html
LISTSERV Help: http://www.lsoft.com/manuals/user/user.html