XPages: Access resources and their content (2)

By using the same code as described in the previous article you can access the complied java classes. To get the correct path you have to do the following:

1. Select the java element you want to access

2. Have a look inside the „$ClassIndexItem“ field

3. This is the path of the compiled Java class:

4. Change the variable url to the specific path

var url = "WEB-INF/classes/ch/hasselba/jsf/servlet/MyServletFactory.class";

The first 30 Bytes of the resulting output are for internal use only and have to be skipped. They contain header informations like the length of the java class. The compiled java class starts from &HCAFEBABE.

It is even possible to access the generated XPages code. In this case there are multiple classes in a design document. For the XPage „Demo.xsp“ the two generated classes are:

var url = "WEB-INF/classes/xsp/Demo.class"

and

var url = "WEB-INF/classes/xsp/Demo$DemoPage.class"
Dieser Beitrag wurde unter Java, ServerSide JavaScript, XPages abgelegt und mit , , , , , verschlagwortet. Setze ein Lesezeichen auf den Permalink.

Schreibe einen Kommentar

Deine E-Mail-Adresse wird nicht veröffentlicht. Erforderliche Felder sind mit * markiert.