4 Replies Latest reply on Mar 16, 2009 4:23 PM by Francois Eric

    RequestParameter from AbstractResource

    Francois Eric Novice


      I'm trying to access a request parameter from my resource but don't know how...

      here is an example of url:


      and here is my code:

      public class ImportationResource extends AbstractResource {
          public String getResourcePath() {
              return "/importation";
          String startDate;
          String endDate;
          public void getResource(final HttpServletRequest request, final HttpServletResponse response)
                  throws ServletException, IOException {
              new ContextualHttpServletRequest(request) {
                  public void process() throws IOException {
                      doWork(request, response);
          private void doWork(HttpServletRequest request, HttpServletResponse response) {
              try {
                  ImportationAction importation = (ImportationAction) Component.getInstance(ImportationActionImpl.class);
                  Date startDateValue = startDate != null ? DateManipulations.getInstance().ISO_DATE_FORMAT.parse(startDate) : null;
                  Date endDateValue = endDate != null ? DateManipulations.getInstance().ISO_DATE_FORMAT.parse(endDate) : null;
                  importation.importDailyData(startDateValue, endDateValue);
              } catch (Exception e) {
                  try {
                  } catch (IOException e1) {
                      //Do nothing

      Unfortunately, when I debug I notice that startDate and endDate are always null.  How can I get them otherwise?