Testing of Java packages and such..

iDenTiTy

Expert Member
Joined
Apr 14, 2007
Messages
3,899
Reaction score
2
Location
Fourways (vicinity)
I feel so lost.

:(

I have never developed with Java, and now am supposed to create Webservices for a Website bla bla bla..

So here's my code (for now - just to see how things look):

package test;

import javax.servlet.*;
import javax.servlet.http.*;
import java.io.*;

@SuppressWarnings("serial")

public class TestApp extends HttpServlet
{

public void doGet(HttpServletRequest req, HttpServletResponse resp)
throws ServletException, IOException
{
String data = req.getParameter("data");
PrintWriter out = resp.getWriter();
if (data == null)
{
out.println("success");
}
else
{
out.println(data);
}
out.close();
}
}

How do I test the above testapp.java package in Eclipse?
Like in Visual Studio had 'build' and I could see what was happening in C#..

:confused:
 
Eclipse does the "compile-on-the-fly" thing, so as you code it should give you any build errors.

Unfortunately, I can't help you in testing the darned thing. :erm:
 
You will need a web server with a servlet container like Tomcat or JBoss.

You can look at using Apache Axis as the runtime if you want to turn your servlet into a web service.
 
Top
Sign up to the MyBroadband newsletter
X