java - How to get action url in jsp using Struts 2 -


i have url: http://demo.lendingclub.com/account/summary.action. when visit url, first go authenticate interceptor, in interceptor class, if use:

string uri = req.getrequesturi(); 

it return /account/summary.action

but if use in jsp:

<%     httpservletrequest req = servletactioncontext.getrequest();     string uri = req.getrequesturi(); %> 

it return : /mainapp/pages/account/summary.jsp

why they're different, , how can action url in jsp?

the easiest way current actions url is: <s:url/> if supply namespace , action parameters can make point @ other actions without these parameters defaults current url.


Comments

Popular posts from this blog

user interface - Python attempting to create a simple gui, getting "AttributeError: 'MainMenu' object has no attribute 'intro_screen'" -

jquery - Common JavaScript snippet to share files on Google Drive, Dropbox, Box.net or SkyDrive -

Android Gson.fromJson error -