Hi Lucas, I am getting an error while i run above code in tomcat.It says that i need to import br.com.sankhya.dwf.controller.servlet.SnkDefaultServlet. Can you help me with this please?
On Aug 8, 2:09 pm, Lucas Boaventura <[email protected]> wrote: > ive done it by servlet. here is the code, if you need any help contact > me but study about servlets before copying and paste. > /* > * Created on 27/07/2011 > * > */ > package br.com.mycompany.mycompanyproduct.servlet; > > import java.io.BufferedReader; > import java.io.IOException; > import java.io.InputStreamReader; > import java.io.PrintWriter; > import java.net.URL; > import java.util.HashSet; > import java.util.Set; > > import javax.servlet.ServletException; > import javax.servlet.http.HttpServletRequest; > import javax.servlet.http.HttpServletResponse; > > import br.com.sankhya.dwf.controller.servlet.SnkDefaultServlet; > import br.com.sankhya.dwf.view.applets.util.Base64Impl; > > /** > * @web.servlet name="crossDomainRedirect" > * display-name="Cross-Domain Redirect" > * description="a description" > * @web.servlet-mapping url-pattern="/crossdomain.redirect" > * > */ > public class CrossDomainRedirectServlet extends SnkDefaultServlet { > > private static Set<String> allowDomains; > > static{ > allowDomains = new HashSet<String>(); > allowDomains.add("maps.googleapis.com"); > } > > protected void doGet(HttpServletRequest request, HttpServletResponse > response) throws ServletException, IOException { > doPost(request, response); > } > > protected void doPost(HttpServletRequest request, HttpServletResponse > response) throws ServletException, IOException { > try{ > String urlBase64 = request.getParameter("URL"); > if(urlBase64 == null){ > urlBase64 = request.getParameter("url"); > } > > URL url = null; > > if(urlBase64 != null){ > String decodedUrl = new > String(Base64Impl.decode(urlBase64)); > url = new URL(decodedUrl); > if(!allowDomains.contains(url.getHost())){ > throw new Exception("The domain you > are trying to bypass is not allowed!"); > } > } > > BufferedReader in = new BufferedReader( > new InputStreamReader( > url.openStream())); > > response.setContentType("text/xml"); > PrintWriter out = response.getWriter(); > > String inputLine; > > while ((inputLine = in.readLine()) != null) > out.println(inputLine); > > out.flush(); > out.close(); > } catch(Exception e) { > e.printStackTrace(); > response.setContentType("text/xml"); > PrintWriter out = response.getWriter(); > out.println("<?xml version=\"1.0\"?>"); > out.println("<erro descricao=\""+e.getMessage()+"\"/>"); > out.flush(); > out.close(); > } > } > > } > > 2011/8/8 kanak3 <[email protected]>: > > > > > > > > > > > I think i can use Java Servlet...I do not know anything about it..i > > will have to go thro the tutorial > > firsthttp://java.sun.com/j2ee/tutorial/1_3-fcs/doc/Servlets.html.. > > > On Aug 4, 8:40 pm, Lucas Boaventura <[email protected]> wrote: > >> You are not right at all. The remote server you are trying to access > >> must have that file, if you dont have access to that server then you > >> MUST do it server side, client side(like AS3 or JavaScript) is > >> impossible cuz modern browsers block it for security reasons, more > >> specifically XSS atacks. > > >> On 3 ago, 23:59, Thiago Cordeiro <[email protected]> wrote: > > >> > Hi, Your remote server must have a cossdomain file to get connection, > >> > google > >> > 'flex crossdomain' to learn how it work > > >> > Best Regards, > >> > Thiago > > >> > 2011/8/3 kanak3 <[email protected]> > > >> > > Hi Everybody, > >> > > I am trying to connect to the remote server using SOAP and WSDL. I > >> > > used the Data Services wizard to connect to a service, but i am > >> > > getting an error: "An error occurred. The wizard cannot complete > >> > > successfully." > > >> > > Basically the requirement is that i should connect to the server using > >> > > soap,I have been provided the WSDL URI.This document has a method > >> > > named GetIncidentList().I need to extract all the Incidents in the > >> > > Dropdown Box using Flex Combobox. > > >> > > Can someone help me here? > > >> > > -- > >> > > You received this message because you are subscribed to the Google > >> > > Groups > >> > > "Google Maps API For Flash" group. > >> > > To post to this group, send email to > >> > > [email protected]. > >> > > To unsubscribe from this group, send email to > >> > > [email protected]. > >> > > For more options, visit this group at > >> > >http://groups.google.com/group/google-maps-api-for-flash?hl=en. > > > -- > > You received this message because you are subscribed to the Google Groups > > "Google Maps API For Flash" group. > > To post to this group, send email to > > [email protected]. > > To unsubscribe from this group, send email to > > [email protected]. > > For more options, visit this group > > athttp://groups.google.com/group/google-maps-api-for-flash?hl=en. > > -- > SRN, Saudações hexacampeã Rubro-Negras, > Lucas Boaventura > (34)9966-3434 -- You received this message because you are subscribed to the Google Groups "Google Maps API For Flash" group. To post to this group, send email to [email protected]. To unsubscribe from this group, send email to [email protected]. For more options, visit this group at http://groups.google.com/group/google-maps-api-for-flash?hl=en.
