File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
The moose likes Other Java Products and Servers and the fly likes problem with the jetty embedded server. Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login

Win a copy of Customer Requirements for Developers this week in the Jobs Discussion forum!
JavaRanch » Java Forums » Products » Other Java Products and Servers
Bookmark "problem with the jetty embedded server." Watch "problem with the jetty embedded server." New topic

problem with the jetty embedded server.

madura shantha

Joined: Jun 04, 2008
Posts: 8

I have a problem of the jetty embedded server with the servlets. First I start the jetty embedded server and sends a request to the server. In the server, a servlet is running and according to the request,the request is forward to a jsp by the servlet. The problem is, when I am doing this, it gaves an exception. It comes from the place where I forward the request from the servlet to the jsp.

Here is the doPost method in the servlet code.

protected void doPost(HttpServletRequest request,
HttpServletResponse response)
throws IOException {

String requestXml = createRequestXml(request);

for (int i = 0; i < ecgsRequests.length; i++) {
String ecgsRequest = ecgsRequests[i];
if (requestXml.indexOf(ecgsRequest) != -1) {
String forwardUrl =
"/WEB-INF/jsp/response/" +
forwardMappings.get(ecgsRequest);//this is where the exception comes.
try {
request.setAttribute("xml", requestXml);
.forward(request, response);
} catch (ServletException e) {

And here is the place where I have the server code.

server = new Server();
SocketListener listener = new SocketListener();

WebApplicationContext webappcontext = new WebApplicationContext();
WebApplicationHandler webApplicationHandler = new WebApplicationHandler();
webappcontext.addHandler(new ResourceHandler() );

This is the client who calls the server.

client = new HttpClient();

method = new PostMethod("");
header = new Header("content-type", "text/xml");
RequestEntity requestEntity = new StringRequestEntity(toSent, "text/xml", "ISO-8859-1");//toSent is the //String to be sent.
int statusCode = client.executeMethod(method);

Can any one help me?
thanks in advance.


Madura Shantha.
I agree. Here's the link:
subject: problem with the jetty embedded server.
jQuery in Action, 3rd edition