Announcement Announcement Module
Collapse
No announcement yet.
how to get HttpServletRequest object in annotation Portlet???? Page Title Module
Move Remove Collapse
X
Conversation Detail Module
Collapse
  • Filter
  • Time
  • Show
Clear All
new posts

  • 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><portletaram 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
Working...
X