1

I have a VisualForce/APEX page that I am posting to through a form. I send over a list of contacts as a single string. When I get to the other page I use the following code to retrieve the post parameters:

ApexPages.currentPage().getParameters().get('contacts');

I am posting the data using the method described in this other question that I asked. I thought it was working perfectly, but then I noticed that after I logged in and went to the page that first time, the getParameters map would be empty.

I suspect that the page has some kind of internal redirect on the server and is not passing the post data along. This is likely a security issue to ensure that the user is authorized to view that page the first time that they try and access it.

Does anyone know of a work around for this problem?

  • @KeithC Hey, you helped me on my last question about this same setup and was wondering if you have ever run into this issue when you are posting data to a VisualForce page. – Joshua Harris Aug 22 '14 at 19:27
  • 1
    It appears to be necessary to specify the full URL in the post action if you want the parameters map to be populated. This is described in Re: Get POST data via visualforce page and used in my blog post How to pass a large number of selections from a standard list view to a Visualforce page. Have you tried that? – Keith C Aug 22 '14 at 20:29
  • Yeah you use c.__some_org__.visual.force.com/apex/__some_page__. The page won't even load without the full url because they are in completely different domains. I can usually pull out the post data, but on the first time that I load up that page after logging in the post data is empty. I suspect that when I hit that domain for the first time the server redirects me to an authentication script/page which ends up dropping the post data. – Joshua Harris Aug 22 '14 at 23:53
  • Yeah I think you are right. Its one thing to carry GET parameters across a login page but a POST that could have large volumes of data is a different thing. – Keith C Aug 23 '14 at 8:16

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.