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"?>
<allow-access-from domain="*" secure="false" />
<allow-access-from domain="*" secure="false" />
<allow-access-from domain="*" secure="true" />

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:

C# scan cs file and find variables values and names

using Microsoft . CodeAnalysis ; using Microsoft . CodeAnalysis . CSharp ; using Microsoft . CodeAnalysis . CSharp . Syntax ; using Xunit . ...