Warning: file_get_contents(/data/phpspider/zhask/data//catemap/5/url/2.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Url localhost在/_Url_Gwt_Localhost - Fatal编程技术网

Url localhost在/

Url localhost在/,url,gwt,localhost,Url,Gwt,Localhost,因为我在localhost模式下运行代码,我有localhost:8080/url/hello。是/之后的值,是目录或路径,因为我得到的结果是HTTP状态404 public void onValueChange(ValueChangeEvent<String> event) { String a=Window.Location.getHref(); Window.alert(a); if(Window.L

因为我在localhost模式下运行代码,我有localhost:8080/url/hello。是/之后的值,是目录或路径,因为我得到的结果是HTTP状态404

   public void onValueChange(ValueChangeEvent<String> event)
{

           String a=Window.Location.getHref();
           Window.alert(a);     
        if(Window.Location.getHash().equals("") || Window.Location.getHash().equals(null) || Window.Location.getHash()== null)
        {
            String SUBURL=a.substring(a.lastIndexOf("/")+1;
                String a1=SUBURL;
                Window.alert("LINK :: "+a1);

            if(!a1.isEmpty())
            {
                greetingService.shrturl(a1,new AsyncCallback<String>()
                  {

                   @Override
                   public void onFailure(Throwable caught) 
                    {

                     Window.alert("fail");

                    }

                    @Override
                    public void onSuccess(String h) 
                    {
                        System.out.print("return value :: "+h);
                        if(h.equals(null))
                        {
                            Window.Location.replace("ERROR:PAGE NOT FOUND");
                        }
                        else
                        {
                             Window.Location.replace(h);
                        }
                    }

                  }); 
            }
            else
            {
                new shorturl();
            }
        }

Localhost:通知服务器自行循环,因此不向forgien服务器发送HTTP请求以将其发送到本地服务器

8080:,表示端口号

/url/hello/指本地服务器中的目录结构

因此,如果您要将代码从本地迁移到live,那么是的

http://localhost:8080/url/hello
将成为

http://www.mywebsite.ie/url/hello

不完全是这样,这取决于您的web服务器的配置方式,例如它可以是虚拟目录、符号链接、受重写规则影响的路径等。您能否详细说明您所说的内容?它只是http向其发出请求的资源。它是你想要的任何东西。如果愿意,您可以在收到/url/hello的请求时返回PDF。谢谢,,你能澄清我的疑问吗,因为我们有www.tinyurl.com网站,他们从长url中生成了一个很小的url。他们有一个域,然后/他们将长url存储在其中。所以目录或他们将值存储在其他地方。tinyurl或任何这些网站,对你的url进行散列,将长url存储在数据库中,并为您提供一个链接到该数据库的短url,然后将您重定向到原始数据库。。如果你喜欢我的帖子,你能把它标记为“有帮助”吗?谢谢如果我必须这样做,那么我该怎么做?你到底想做什么?你应该把生成的URL放在一个标签中,然后在你的站点中显示出来,我不清楚你到底想通过href=tinyurl实现什么。我们可以转到我存储在DB中的链接,但是当该href粘贴到地址栏中时,该URL应该打开,我已经存储在DB中了。但我不明白。