cancel
Showing results for 
Search instead for 
Did you mean: 

AbstractPortalComponent - do anything after response was send to client

Former Member
0 Kudos

Hi,

in AbstractPortalComponent our method doContent(IPortalComponentRequest request, IPortalComponentResponse response) is generating a response. For this response this method also creates a js file which will be included into the response.

We want to delete the js file a f t e r the response was send. We have tried it with doAfterContent(IPortalComponentRequest request, IEvent event). This doesnt work properly,... the js file is deleted too soon.

Any advice ?!?

Flo

Accepted Solutions (1)

Accepted Solutions (1)

0 Kudos

Hi,

If the response is already sent to the browser, from where to you want to delete the js file?

Do you save this js in some session or some where?

If so then delete this, in the start of your doContent method.

I would suggest some code logic like this:

The first time you generate the JS, place it in request. So always read request to see if JS already exists, if not create JS and place in request. While including JS in responce, always take it from request object. So the JS is only available for one request/responce cycle. Every request/responce has its own JS.

Regards,

Praveen Gudapati

Former Member
0 Kudos

Hi,

thanks for your answer. I know it is confusing that I want to save the javascript file on filesystem and delete it a f t e r the response.

I want to hide parameters in an applett, because of this I am using a javascirpt include. In the js file are the parameters with document.write(). So I can avoid that the users can read the parameters in the html source.

Probably I can´t delete the js file after the response was send in AbstractPortalComponent, right ? What for other solutions could I use ?

Regards

Flo

0 Kudos

Hi,

If I understand you right, then you want to delete the JS file which you sent to client in your response from server side. This is not possible, you can only replace this file, by sending a new file with same name in the next responce.

Regards,

Praveen Gudapati

Answers (0)