java - Wicket: Get URL from browser -


i need retrieve url current web page opened in firefox using wicket. can tell me how that?

you need query underlying httpservletrequest:

public class dummypage extends webpage{      private string getrequesturl(){         // wicket-specific request interface         final request request = getrequest();         if(request instanceof webrequest){             final webrequest wr = (webrequest) request;             // real thing             final httpservletrequest hsr = wr.gethttpservletrequest();             string requrl = hsr.getrequesturl().tostring();             final string querystring = hsr.getquerystring();             if(querystring != null){                 requrl += "?" + querystring;             }             return requrl;         }         return null;      }  } 

reference:


Comments

Popular posts from this blog

ASP.NET/SQL find the element ID and update database -

jquery - appear modal windows bottom -

c++ - Compiling static TagLib 1.6.3 libraries for Windows -