我创建了一个类似的表格;
<portlet:actionURL var="myFriendlyURI">
<portlet:param name="action" value="addUser"></portlet:param>
</portlet:actionURL>
<form id="userForm" name="userForm" action="${myFriendlyURI}" method="post">
Name :- <input type="text" name="userName">
<input type="submit">
</form>
在 processAction(ActionRequest request, ActionResponse response) 方法中,如何根据 myFriendlyURI 识别请求 URI?
request.getAttribute("javax.servlet.forward.request_uri").toString()) is giving only "/web/portal/Adduser-PageName".
我只想像在 Servlet 类中一样检查请求;
if(request.getRequestURI().endsWith("user/add")) { // <form action="user/add" ..... >
System.out.println("Ends with : user/add ");
// do actions here
}