jakarta-cactus-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Alexander Lepekhine" <pa...@mail.ru>
Subject ClassCastException at ServletTestCase
Date Fri, 16 Aug 2002 08:32:35 GMT
I am sorry, ClassCastException was raised due to my fault:
I fogot to change 
theRequest.setRedirectorName("JspRedirector");
to
theRequest.setRedirectorName("ServletRedirector");
in authentication request.

So, the one question remains:
How to set request parameters?
I am doing the next:

/**
 * Test getData()
 */
 public void beginGetData(WebRequest web_request) {
   doAuthentication(web_request, "operator", "operator");
   web_request.addParameter("class_id","New category");
 }
 public void testGetData() {
   try {
     logger.info("getData() entered");
     logger.info("class_id:"+request.getParameter("class_id")+":");
     state = new Attr_add();
     state.setRequest(request);
     state.getData();
   } catch (Exception e) {
      e.printStackTrace();
      logger.error(" got exception "+e.getMessage());
      assertEquals("no errors", e.getMessage());
   }
}

Here "state" is a server object that use request parameters.
As I see request.getParameter("class_id") gets emty string
instead of "New category". Is it right?
Or should I really call some servlet for parameter passing?
Alexander


--
To unsubscribe, e-mail:   <mailto:cactus-user-unsubscribe@jakarta.apache.org>
For additional commands, e-mail: <mailto:cactus-user-help@jakarta.apache.org>


Mime
View raw message