开发者

How can I put an active URL in a textbox?

开发者 https://www.devze.com 2022-12-16 21:21 出处:网络
Using JSP, how can I put an active URL in a t开发者_开发百科extbox?Well there are 2 ways [server side and client side]:

Using JSP, how can I put an active URL in a t开发者_开发百科extbox?


Well there are 2 ways [server side and client side]:

in JSP you can do something like this to retrieve the URL that is currently loaded:

<input type="text" id="currentURL" value="<%= request.getRequestURI() %> " />

you can also try to use request.getRequestURL() depending on what you need.

More info on this page: http://www.theserverside.com/discussions/thread.tss?thread_id=5651

You can also retrieve the same info by using JavaScript:

var currentURL = document.location;

and then assign it to the input field you require.

0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号