The latest project needs to jump to the specified action in Js. Through continuous experiments and materials, we finally succeeded. In the Java SSH2 architecture, the action configuration is complete. Under XXX. jsp
<SCRIPT type = "text/JavaScript">
Window. Location = "<% = request. getcontextpath () %/namespace/actionname> ";
Example: window. Location = "<% = request. getcontextpath () %>/user/resaction> ";
Resaction is the name of the action in the configuration file.
</SCRIPT>
You can jump to the specified action through the preceding steps.
But one of the questions I'm wondering about is:
<%
String Path = request. getcontextpath ();
String basepath = request. getscheme () + "://"
+ Request. getservername () + ":" + request. getserverport ()
+ Path + "/";
%>
I have already written the above URL code on the JSP page. Why do I need to write it again in window. Location = "<% = request. getcontextpath () %>? A friend who wishes to know left me a message. Thank you.