Friday, February 01, 2008

JSP http post arguments/parameters

yesterday I was looking for a way to print some values from http POST. then I could not find easy example. this was about getting values from some swf. first I wrote this:

for(Enumeration i = request.getParameterNames();i.hasMoreElements();){
String parName=(String)i.nextElement();
out.write("parameter:"+parName+" value:"+request.getParameter(parName));
System.out.println("parameter:"+parName+" value:"+request.getParameter(parName));
}

this was working very well I tried it from browser address bar. but then there was a strange exception about security and stuff. like this:
[2008-01-31 19:18:17,140] resin-tcp-connection-*:80-11 WARN org.springframework.web.servlet.PageNotFound - No mapping for [/crossdomain.xml] in DispatcherServlet with name 'pageFlow'

as you see sound like spring exception. then I convert the *.xml line to rss.xml in web.xml. because there was only one rss.xml request which has to be handled by spring. after that I have to find a crossdomain.xml for swf. example:
<?xml version="1.0"?>
<cross-domain-policy>
<allow-access-from domain="*.macromedia.com" secure="false" />
<allow-access-from domain="*.adobe.com" secure="false" />
<allow-access-from domain="*.mydomain.com" secure="true" />
</cross-domain-policy>

the important part we have to say our domain is secure=true otherwise same exception stays. now my http post printer is working.

No comments:

odd string diff

 https://leetcode.com/problems/odd-string-difference/ Beats 19.92% of users with Java   class Solution { public String oddString ( S...