cancel
Showing results for 
Search instead for 
Did you mean: 

400 Bad Request

Former Member
0 Kudos

Hello,

We have the problem for printing in Web Dynpro.

In our report we have link "Print". When user clicks at this link we generate HTML page, by adding html lines to StringBuffer


StringBuffer xml_file = new StringBuffer();

...

xml_file.append("</TBODY></TABLE></div></BODY></HTML>");

Then, when we added all html lines, we create WEB resource and get the url to this resource:


IWDCachedWebResource xlfile = WDWebResource.getWebResource(xml_file.toString().getBytes("UTF-8"), WDWebResourceType.HTML);

linktoFile = xlfile.getURL();

and open new page using this URL.


wdComponentAPI.getWindowManager().createNonModalExternalWindow(linktoFile ).show();

But sometimes when user clicks "Print" we get blank page with the status/message "400 Bad Request". Then user can click "Print" again and all is ok. So data, which we want to display, are nor guilty.

I think that it may happens because created resource is expired and doesn't exist.

Please advise how it can be solved.

Regards,

Alex

Accepted Solutions (1)

Accepted Solutions (1)

Former Member
0 Kudos

Hi,

Have you tried using getPublicCachedWebResource instead of getWebResource ?

Aviad

Former Member
0 Kudos

Hello Aviad,

Thank you. Seems that it works.

But now I get another question.


IWDCachedWebResource xlfile = WDWebResource.getPublicCachedWebResource(b, WDWebResourceType.HTML, WDScopeType.CLIENTWINDOW_SCOPE, deplPart, "PrintDowntimeLine");

How long will pages, which were generated using this method, will be available?

Pages which were generated few hours ago are still available

I tried all types of WDScopeType, I closed the browser, but pages are still accessable using URLs.

I am afraid that these files may fill up the file system of server.

Former Member
0 Kudos

Hi,

According to http://help.sap.com/javadocs/NW73EHP1/SPS14/CE/wdr/com.sap.wdr/index.html there are only two types of scopes APPLICATION_SCOPE  and TASK_SCOPE.

My guess is that they both rely on browser cache somehow.

Aviad

Former Member
0 Kudos

Thanks Aviad,

Yes generated pages are accessible because they are cached in browser

Answers (0)