-
May 28th, 2009, 08:29 PM
#1
how to get HttpServletRequest object in annotation Portlet????
Hi,guys
I got a question,how to get HttpServletRequest object if I used annotation in Portlet,just see below code:
in JSP:
<script type="text/javascript">
function <portlet:namespace/>_loadnewData(){
$.ajax({
type:"POST",
url: '<portlet:renderURL><portlet
aram name="action" value="navigate-termialList"/></portlet:renderURL>',
data: "currentUser=testingUser",
success: function(response) {
var div = document.getElementById("<portlet:namespace/>_airplaneschedule");
div.innerHTML = "";
div.innerHTML = response;
},
error: function(xhr) {
alert('Error! Status = ' + xhr.status);
}
});
}
</script>
in my Controller:
@RequestMapping(params = "action=navigate-termialList")
public String listTermialList( ModelMap model,RenderRequest request,RenderResponse response) {
....
for(Object s : valuez.keySet()){
System.out.println(s.toString());
}
String currentUser = request.getParameter("currentUser");
System.out.println("currentUser>>>>>>"+currentUser );
...
}
after run,print result is null,it's means that no this parameter
but if I change to servlet,can get the value by HttpServletRequest Object,
so,got this question,does any body hit it before?
thank you
Tags for this Thread
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules