cancel
Showing results for 
Search instead for 
Did you mean: 

Displaying Static File

Former Member
0 Kudos

Hi

I'm want to display the static html file ( kept in the project folders) in following three ways.

1. The static html file open in new window

2. the static html file opening in the same window.

3. the static html file opening in different pane of the same window (like using IFrame )

I tried using the linkToUrl UI Element and for the last one linkToAction UI Element.

My question is :

a) How do I call the HTML file and send it to a context.

b) Where should i insert the code, i mean in which method i should write the code.

can some one can provide me solution to my problem, given the specifications i want to develop it.

Thanks in Advance

Srikant

Accepted Solutions (1)

Accepted Solutions (1)

Former Member
0 Kudos

Hi guys,

I've found a little method and it work fine.

Don't forget to reward points

The method is:

Create an <b>HTTP aliases in the J2EE AS JAVA.</b>

1. Create a folder where you want to put your static files :

ex: <b>c:/folder1</b>

put your index.html file and other ressources

2. Create an aliases in the http provider

Go to Visual Admin Tool.

Go to your <b>server node -> services -> HTTP PROVIDER</b>

In <b>Virtual Host tab</b>

click on default

then on the right, go to <b>Aliases tab</b>

in field Alias put the name you want: ex=<b>test</b>

in field path put the path you have created: <b>ex=c:/folder1</b>

<b>click on Add button</b>

<b>click on save properties</b>

Don't forget to clear cash, some time you have to restart the server.

Go to :

<b>http://<your host>:<your port>/test</b>

It's working !

<b>I hope it can help a lot of people.

Don't forget to reward points ;)</b>

Thanks

Regards

Gregory

Answers (1)

Answers (1)

Former Member
0 Kudos

Hi Srikant,

Refer to the following thread

Hope this will be useful to you.

Regards,

Santhosh.C

Former Member
0 Kudos

Hi

Well i tried but it didn't work out can anyone look into this and tell me how to achieve this.

I'm getting error in wdInit method.

Thanks

Srikant

Former Member
0 Kudos

Venkata,

Out telepathic skills give up trying to find what's wrong in your wdDoInit method

Please show your code. And complete stack trace (with nested "Caused by" clauses

VS

Former Member
0 Kudos

Hi Valery

well i want to know the genric method for solving how to go about displaying the HTML file kept in my project folder.

Can you please help me out with this. i have used Http aliases method. it works fine. I want to know how we can do the same(all three situations by keeping the file in the project folders)

Thanks in advance

Srikant

Former Member
0 Kudos

Venkata,

In all 3 cases you have to use WDURLGenerator to get absolute URL to your file. Please read Java Docs supplied with NetWeaver

1. Opening url in new window --

2. Opening in same window (leaving application via exit plug) --

3. Just bind source of IFrame to string attribute of context, and assign URL to this attribute

VS

Former Member
0 Kudos

Hi All,

Thanks for the providing me suggestions it didn't worked.

I would like to know the procedure in which you include the static HTML files in project and then displayed using both : <b>LinkToURL</b> & <b>LinkToAction</b> UI Element.

Someone suggested using the FileOutputStream.

Can someone just explain the procedure step wise how to display the HTML Files kept in project(kept in MIMES Folder) using both the UI Elements.

Thanks in advance

Srikant