Current Position:Home > How to get HttpRequest in AbstractCommand

How to get HttpRequest in AbstractCommand

Update:11-30Source: network consolidation
Advertisement
Hi,
I wrote a custom command extends AbstractCommand, which returns a URL in getLinkAttributes(). Now I want to set some values along with the returned URL, for example, in getLinkAttributes():
return new LinkAttributes("http://mydomain/viewer?param1=value1", "_blank");
Is there any way to send this value not in the URL, but in cookie or session? I don't how to access HttpRequest or something like that in AbstractCommand.
Thanks,
Ray

The Best Answer

Advertisement
Hello Ray,
You can get the HttpServletRequest in you Command like this:
IPortalComponentRequest pcr =(IPortalComponentRequest) getProxy().getDynamicPage().getPageContext().getRequest();
HttpServletRequest servletRequest = pcr.getServletRequest();
So now you can put your values in session <b>servletRequest.getSession().setAttribute(beanName, bean);</b> , Hope this helps ...
Greetings,
Praveen Gudapati
p.s. points are always welcome for helpful answers
  • How to get HttpRequest in AbstractCommand Update:11-30

    Hi, I wrote a custom command extends AbstractCommand, which returns a URL in getLinkAttributes(). Now I want to set some values along with the returned URL, for example, in getLinkAttributes(): return new LinkAttributes("http://mydomain/viewer?param1

  • Help with httprequests and responses Update:10-11

    it is my first time writing a servlet, but i need one to work with a project i'm working on. I have a class that will do all the methods on the server side of the project, but my problem now which i need to resolve, is how to get my client side app (

  • Can't reuse HTTPRequest  --- how can I reuse this code? Update:10-11

    public var getCategories: HttpRequest = HttpRequest {     location: "http://lydias-kitchen.com/FXcategories.php";     onInput: function(is: java.io.InputStream) {         try {             if(is.available()> 0){               categories.parse

  • Using httprequest object Update:11-30

    I'm a struts frame work developer and I'm trying to populate combobox using httprequest object. The code seems working( I debugged it) don't populate the combo. My code is as follows. <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN&q

  • Displaying HttpRequest Parameter in UIX page Update:11-30

    Hi team, On one page I select a value from a dropdown list - this gets saved as a request parameter on the sessionData (standard behaviour). 16:06:57 DEBUG (JhsActionServlet) -Parameter Shipment: 121What I want to do is refer to that value in a subse

  • Custome headers in HttpRequest Update:11-30

    Hello, I am having some problems including extra headers in my HttpRequest. I've tried it with ActionScript and mxml too, but no headers were added. All I know is that I should use an Object. This is what I have experimented with so far: var Header:O

  • Implement new AbstractCommand, AbstractScreenflow, and WcmResourceControl Update:11-30

    Hi all... I am currently trying to implement a new SAP KM functionality which allows the user to see how a specific resource property has changed through all it's revisions. I decompiled the code for UIPropertiesCommand (UIPropertiesCommand, Properti

  • Httprequest file upload Update:11-30

    I have a situation where the default file upload functionality via fileReference will not work.  This is because of runtime security errors in different environments, and the server is running php with session handlers - the fileReference upload func

  • Retrieving special characters through an HttpRequest Update:11-30

    Why I can not retrieve special characters like accents, spanish chars, etc. through an HttpRequest? Instead of the special char I want to retrieve it always changes them to another symbol. For example (ni�o, informaci�n) Is there any way to do it? Th

  • Map HttpRequest parameters to anytype of object Update:11-30

    Hi, I am working on an old project and at the moment the only method they have to map the parameters of an HttpRequest to that of a custom object is by actually getting the value from the request and put it in the custom object one parameter at a tim