on 04-03-2011 12:34 PM
Hey
I want to create a dynamic HTML page similar to this examples:
/people/valery.silaev/blog/2005/11/23/display-formatted-text-using-webdynpro-for-java
The problem is both are for Web Dynpro Java , and i cant seem to find the equivalent statements in ABAP for:
- "final IWDCachedWebResource resource = WDWebResource.getWebResource" cant find a WebResource with the same methods in ABAP
- formattedStr.getBytes("UTF-8")
Could anyone help me ?
Thanks
Thaks Thomas
I think i need something just like this , im gonna give it a go later today
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
If you need just plain HTML content, why would you not use BSP instead of WDA? Do you want to embedd HTML within an iFrame in WDA? If that is the case, it is possible although the approach is different than WDJ. Here is a sample:
data lo_el_text type ref to if_wd_context_element.
data lv_html_text type wd_this->element_text-html_text.
data lv_iframe_url type wd_this->element_context-iframe_url.
lo_el_text = wd_context->get_child_node( name = wd_this->wdctx_text )->get_element( ).
lo_el_text->get_attribute(
exporting
name = `HTML_TEXT`
importing
value = lv_html_text ).
****Create the cached response object that we will insert our content into
data: cached_response type ref to if_http_response.
create object cached_response
type
cl_http_response
exporting
add_c_msg = 1.
* cached_response->set_compression( options = cached_response->IF_HTTP_ENTITY~CO_COMPRESS_IN_ALL_CASES ).
try. " ignore, if compression can not be switched on
call method cached_response->set_compression
exporting
options = cached_response->co_compress_based_on_mime_type
exceptions
others = 1.
catch cx_root.
endtry.
****set the data and the headers
data: l_app_type type string.
cached_response->set_cdata( lv_html_text ).
l_app_type = 'text/html'.
cached_response->set_header_field( name = if_http_header_fields=>content_type
value = l_app_type ).
cached_response->set_status( code = 200 reason = 'OK' ).
cached_response->server_cache_expire_rel( expires_rel = 60 ).
data: guid type guid_32.
call function 'GUID_CREATE'
importing
ev_guid_32 = guid.
concatenate '/sap/public' '/' guid '.' 'html' into lv_iframe_url.
****Cache the URL
cl_http_server=>server_cache_upload( url = lv_iframe_url
response = cached_response ).
wd_context->get_element( )->set_attribute(
name = `IFRAME_URL`
value = lv_iframe_url ).
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
88 | |
10 | |
10 | |
9 | |
7 | |
7 | |
6 | |
5 | |
4 | |
4 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.