betweenGo

JSP Dynamo Request Retrieval

by Frank Kim on Aug.30, 2005, under Page Development, Programming

In JHTML pages, the request object is of class DynamoHttpServletRequest which has many methods that are not part of the HttpServletRequest interface including the very useful resolveName method for looking up components in Nucleus.

In JSP pages on ATG there is no guarantee that the request object is of class DynamoHttpServletRequest. According to the JSP specification the request object always implements the HttpServletRequest interface.

If you need to get the DynamoHttpServletRequest do something like this:

DynamoHttpServletRequest dynRequest  = atg.servlet.ServletUtil.getDynamoRequest(request);

If you need to get a PortalServletRequest do something like this:

PortalServletRequest portalRequest = (PortalServletRequest) request.getAttribute(atg.portal.servlet.Attributes.PORTALSERVLETREQUEST);


  • Share/Bookmark

Related posts:

  1. Get JSTL Vars from PageContext
  2. Getting the request parameter
  3. Trim White Space from JSP
  4. Accessing RepositoryItems with JSTL
  5. Size of collection in a JSP/DSP page

:

2 Comments for this entry

  • Jagadeesh Tangudu

    Thanks,
    It helped me a lot.

    one more doubt I have that, how can convert the atg.portal.servlet.PortalServletRequest object to DynamoHttpServletRequest.

  • Frank Kim

    Unfortunately you can’t convert a PortalServletRequest object to a DynamoHttpServletRequest object. Neither class is a subclass of the other.

Leave a Reply

Looking for something?

Use the form below to search the site:

Still not finding what you're looking for? Drop a comment on a post or contact us so we can take care of it!