Meaningless Drivel is fun!*
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 Android Security Essentials Live Lessons this week in the Android 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.
jQuery in Action, 2nd edition
subject: problem with the jetty embedded server.
Similar Threads
Working with JSP & Servlet paths
Problem download file.
Flushing response and then forwarding not working as expected
OSGi - Embedded Jetty Server - Servlet unable to get reference to Service Tracker
Jetty: wt are the reasons for the doPost method to be called twice?