cancel
Showing results for 
Search instead for 
Did you mean: 

Javascript bootstrap mechanism

Former Member
0 Kudos

Hello

I am interested in finding out how the bootstrap mechanism works for sapui5 applications.

I have installed eclipse with sapui5 addons and created a simple application.

I am puzzled as to how the javascript and css files are loaded.

When I run the application in google chrome I can see that a number of files are loaded from the "resources" folder in the root directory.

But no such folder exists in my root directory.

How and where are these files being loaded from?

Thanks

Andrew

Accepted Solutions (1)

Accepted Solutions (1)

ChandraMahajan
Active Contributor
0 Kudos

Hi,

As per my understanding, it is loaded via web.xml via below coding.

       <!-- ============================================================== -->

       <!-- UI5 resource servlet used to handle application resources      -->

       <!-- ============================================================== -->

       <servlet>

              <display-name>ResourceServlet</display-name>

              <servlet-name>ResourceServlet</servlet-name>

              <servlet-class>com.sap.ui5.resource.ResourceServlet</servlet-class>

       </servlet>

       <servlet-mapping>

              <servlet-name>ResourceServlet</servlet-name>

              <url-pattern>/resources/*</url-pattern>

       </servlet-mapping>

       <servlet-mapping>

              <servlet-name>ResourceServlet</servlet-name>

              <url-pattern>/test-resources/*</url-pattern>

       </servlet-mapping>

Regards,

Chandra

Answers (3)

Answers (3)

AndreasKunz
Advisor
Advisor
0 Kudos

Hi Andrew,

these server-side ResourceHandler components are only for Java servers. On plain web servers the UI5 files are just a directory tree which looks exactly like the URLs requested by the browser. The OpenUI5 downloads and the "static" SAPUI5 downloads contain this directory structure (zipped).

The ResourceHandler was built to enable people to deploy UI5 libraries as JAR archives (the resource handler will look inside those JARs).

Regards

Andreas

Former Member
0 Kudos

https://help.sap.com/saphelp_nw74/helpdata/en/91/f2b4d66f4d1014b6dd926db0e91070/content.htm?fullscre...

Hi Guys

Thanks very much for the responses.
Very helpful, especially the OpenUI5 resources.

After investigating a little further I found the above documentation that explains it well.


Thanks again.

Andrew

Former Member
0 Kudos

Chandrashekhar is correct; Eclipse is doing you this "favour" if your project is a UI5 project.

However, it makes it pretty cumbersome to develop UI5 without Eclipse. If you're interested in the UI5 files itself, download OpenUI5 (OpenUI5 - Download) or use the SAP-internal Repository (in case you're an SAP employee).

We're usually using this approach within the team because it allows us just to zip the entire project and deploy it on any server we want.