简体   繁体   中英

Get PathInfo from RenderRequest

I need to get pathInfo from portlet - RenderRequest . On the documentation - portlet doc's the method getPathInfo should return the String I need but :

    @Override
    protected String setRenderData(RenderRequest request, RenderResponse response) {
        super.setRenderData(request, response);
        request.getPathInfo(); //The method getPathInfo() is undefined for the type RenderRequest
     }

The method is undefiend.

I also tried to cast the request to PortletRequest :

    PortletRequest preq = (PortletRequest) request;
    preq.getPathInfo(); // The method getPathInfo() is undefined for the type PortletRequest

Thanks for any help.

As you're tagging and , I'm assuming that you're referring to JSR-286, the Java portlet spec. This, in turn, leads to javax.portlet.PortletRequest and not org.apache.cocoon.environment.portlet.PortletRequest , that you are linking to. Assuming this is your environment (correct me if you're indeed using cocoon), here's your reason for the method not being available.

And as you don't give any hint what you'd like to use this information for (eg what's the problem you're trying to solve with this data), the answer has to end here. You're just looking up the wrong Javadoc.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM