2014年5月14日星期三

href Jump problem

I want to be a link . But there is always a path past the jump localhost: 8080/MyShopping

$ {link.linkName}

Jump past the path is localhost: 8080/MyShopping/www.baidu.com

how to directly display www.baidu.com
------ Solution --------------------------- -----------------
is not probably like this ? zhidao.baidu.com not, you can add the http://

<% String a = "http://zhidao.baidu.com";%>
> <% = a%>
------ For reference only ---------------------------------------
direct $ {link.linkName}
why not enough to call it by the event
------ For reference only -------------------- -------------------
click

------ For reference only ---------------------------------- -----
just wrong, should be : Baidu
------ For reference only ---------------------------- What -----------
$ {link.linkUrl} is probably the browser automatically resolve the address . . .
------ For reference only -------------------------------------- -
$ {link.linkUrl} I put

because background administrator to add, so you can not write the dead . $ {link.linkUrl} is to get the address . EI expression.
------ For reference only -------------------------------------- -
little jump there is a http://localhost:8080/MyShopping/www.baidu.com
------ For reference only ----------- ----------------------------
have this friend does not understand
------ For reference only ---------------------------------------
click
------ For reference only ------------------ ---------------------
tried, the second way?
------ For reference only -------------------------------------- -
not only jump jump Baidu ah I can not write that one because there are a lot of dead links rolling
------ For reference only ---------------------------------------




your jsp page it is
<%
String path = request.getContextPath ();
String basePath = request.getScheme () + ":/ /" + request.getServerName () + ":" + request.getServerPort () + path + "/" ;
%>





on this page is not there
mainly the
like this default will then add your url to access http://localhost:8080/ project name
------ For reference only ------------ ---------------------------
the $ {link.linkUrl} print this out to see if it contains the value of the extra prefix. . .
------ For reference only -------------------------------------- -
played without any prefix
------ For reference only ------------------------ ---------------
I would now like to understand there's definitely a link in front of a http://localhost:8080/MyShopping
because jsp are there , the question is how to jump out to show a direct $ {link.linkUrl} This value
------ For reference only ---------- -----------------------------

  
  
  
your jsp page it is   
<%   
String path = request.getContextPath ();   
String basePath = request.getScheme () + ":/ /" + request.getServerName () + ":" + request.getServerPort () + path + "/" ;   
%>   
  
  
  
  
  
on this page is not there   
mainly the   
like this will be your default url to access the project name plus http://localhost:8080/  
is jsp but I have deleted these ah
------ For reference only --------------------- ------------------

    
    
    
your jsp page it is     
<%     
String path = request.getContextPath ();     
String basePath = request.getScheme () + ":/ /" + request.getServerName () + ":" + request.getServerPort () + path + "/" ;     
%>     
    
    
    
    
    
on this page is not there     
mainly the     
like this will be your default url to access the project name plus http://localhost:8080/          
is jsp but I have deleted these ah  

deleted if it is really so, this is less scientific oh
------ For reference only --------------------- ------------------
you write a generic method to get url after processing about $ url

------ For reference only ---------------------------------- -----
by linking Jump to Baidu :
$ {link.linkName}
this okay ?
------ For reference only -------------------------------------- -


on this can
------ For reference only ----------------------------- ----------
add http:// to solve a problem . $ {link.linkName}
------ For reference only ---------------------------------------
If you want to jump directly turn not add target label.

target tab to specify where you want to jump , usually in partial refresh when used ( for example, the specified page is displayed to the specified frame inside ) .
currently you use _blank, represents a direct replacement for the current page name , such as test / $ {link.linkUrl} replaced with test / www.baidu.com jump .
------ For reference only -------------------------------------- -
I have encountered this problem and solve it fairly simple. Upstairs at the point on no answer . .

Oh, just so you can :

optimistic , the reason that there is no fill "http://" then the project will think you need to think in this way the basic path to jump. . .

If the fill on this , whether you use href or onclick event you use window.open ('url'); results are correct ! ! ! !

没有评论:

发表评论