Java Web project

After we start the Java Web project in Eclipse, Run As Tomcat or Apache server, Run locally. If you visit the project directly with http://localhost:8080, you will find that the browser will open a default page.

Where is this page configured?

Under each Java Web project directory, there is a directory called web-INF that contains a configuration file called web.xml. The default page for the Web project is defined in the welcome-file-list node.

The Android project

We know that an Android project can define different activities, so the Activity corresponding to the initial page seen after the Android application starts is defined in the Androidmanifest.xml configuration file of the Android project, and the attribute is Android: name. Look at the following example:

Package ="com.jerry.android4" Android :versionCode="1" Android :versionName="1.0" > Android :minSdkVersion="8" android:targetSdkVersion="19" /> android:allowBackup="true" android:icon="@drawable/ic_launcher" android:label="@string/app_name" android:theme="@style/AppTheme" > android:name="com.jerry.android4.MainActivity" android:label="@string/app_name" >Copy the code

Mean the Android default startup activity is com. Jerry. Android4. MainActivity.

Wechat applets

There are many views in my wechat applet. When I was debugging, I found that the input parameter of onLaunch of my app.js hook function was filled with userLogin view by wechat framework. However, according to what logic does wechat framework determine that userLogin is the initial page of wechat applets?

At first I thought it was to configure the initial page in the app. Json or project.config.json file of wechat applets, like the Java Web project Web. It turns out that there is no such configuration, and the wechat framework will use the first page under the Pages property in the app.json file as the initialization page.

To verify this conclusion, let’s do a test that reverses the order of the appointments and userLogin views in app.json. It turns out that the appointments view, currently in app.json, is the starting page.

For more of Jerry’s original technical articles, please follow the public account “Wang Zixi” or scan the following QR code: