xmlhttprequest - POST parameters not seen by ResourceRequest.getParameter -
in liferay 7 have servlet can serve resource:
@override public void serveresource( resourcerequest resourcerequest, resourceresponse resourceresponse) throws portletexception { // parameter log.info("text:" + resourcerequest.getparameter("text")); // debug info log.info("parameters:" + collections.list(resourcerequest.getparameternames())); log.info("resourcerequest:" + resourcerequest); log.info("private:" + resourcerequest.getprivateparametermap()); }
i call post, here request seen wireshark:
post /web/guest/home?p_p_id=nico_my_portlet_myportlet_instance_8bdmsytib7r1&p_p_lifecycle=2&p_p_state=normal&p_p_mode=view&p_p_resource_id=addresurl&p_p_cacheability=cachelevelpage http/1.1 host: localhost:8080 user-agent: mozilla/5.0 (x11; ubuntu; linux x86_64; rv:54.0) gecko/20100101 firefox/54.0 accept: */* accept-language: en-us,en;q=0.5 accept-encoding: gzip, deflate content-type: application/x-www-form-urlencoded; charset=utf-8 x-requested-with: xmlhttprequest referer: http://localhost:8080/ content-length: 53 cookie: cookie_support=true; user_uuid=3553584d6b565a536f614863774a6b486d39477a4f486671726b696452533248654c4c62486a3669376e303d; screen_name=5850595471493466547236592b557174726e4e5a39413d3d; login=74657374406c6966657261792e636f6d; guest_language_id=en_us; company_id=20116; remember_me=true; id=6b76544c52356b5464343664464e4e6d784a30696e673d3d; password=5850595471493466547236592b557174726e4e5a39413d3d; jsessionid=d910a4dff4e53d40bff02eabe79d07ef dnt: 1 connection: keep-alive text=bonjour¬e=bla
log output:
text:null parameters:[] resourcerequest:com.liferay.portlet.resourcerequestimpl@7c4acfc2 private:{}
why getparameter
return null
instead of "bonjour"
?
this you.
uploadportletrequest uploadrequest = portalutil.getuploadportletrequest(resourcerequest); string text = paramutil.getstring(uploadrequest, "text");
Comments
Post a Comment