Atitit. Get AppRoot API App root path java c#.net php asp

Source: Internet
Author: User

Atitit. Get AppRoot API Apply Root Path java c#.net php asp

1.returns /appIf the root path returns empty,compatible with Getcontextpath()

<script type= "Text/javascript" src= ". /com.attilax/core/approot_js.jsp "></script>

<%@ page contenttype= "text/html; Charset=utf-8 "language=" java "import=" java.sql.* "%>

<%

String path = Request.getcontextpath ();

%>

$app _path= "<%=path%>";

App_path= "<%=path%>";

$envi = "Java";

Apiurl= "<%=aaacfg.iocx4jobui.getcfgval (" Hre_web_url ")%>";

$iocx _iner= "Nonex";

$iocx = "Nonex";

author:: Nickname:Old Wow's claws( Full Name::AttilaxAkbar Al Rapanui Attilaksachanui) Kanji Name:Ayron, email:[email protected]

Reprint please indicate source: http://www.cnblogs.com/attilax/

2.but for PHP is a scripting language, there is no approot concept,

PHP generally need to define the root directory of the site, the following is a common code, you need a friend to refer to the next.

Copy Code The code is as follows:


Define (' Base_path ', str_replace (' \ \ ', '/', Realpath (dirname). ' /.. /‘)));

This is to be manually specified in a bad way.

The best practice is to put a __approot file, indicating the path to the application. More dynamic.

3.ASP

Request.applicationpath; ///aspnet

Method 3,request.applicationpath;// get The virtual application root directory of the ASP.

4.Reference

ASP. NET gets the root directory of methods collection _ I love learning Web . htm

Trace Net , trace Net blog , Trace net Studio -henw.htm

ASP. NET Get site root summary details -- Source House (mycodes.net). htm

Atitit. Get approot api  app Root path  java c#.net php asp

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.