all groups > macromedia flash flash remoting > august 2004 >
You're in the

macromedia flash flash remoting

group:

Java - Servlet.


Java - Servlet. Flasham
8/27/2004 10:17:29 AM
macromedia flash flash remoting:
Hi All!

I have a Servlet but can't connect to them from Flash. What i mast write
in first parameter of the gatewayConnection.getService function.

In web.xml:
---
<servlet>
<servlet-name>UserRequest</servlet-name>
<servlet-class>mm.UserRequest</servlet-class>
</servlet>
---


in mm.UserRequest:
---
...
public void service(ServletRequest request, ServletResponse response){
...
}
...
---


In AS:
-----
NetServices.setDefaultGatewayUrl("https://localhost:8080/mm/gateway");
gatewayConnection = NetServices.createGatewayConnection();
adminService = gatewayConnection.getService(???, this)
------


On the Button:
---
on(release){
adminService.UserServlet();
}
--


Thanks
Re: Java - Servlet. maliko50
8/27/2004 5:20:07 PM
I'm not sure if this will help but I have JSP's which are called from Flash. In
your code:

"adminService = gatewayConnection.getService(???, this)"

I believe the first parameter is the name of your application as listed with
Tomcat. Then to call servlet, I would use:

adminService .SERVLET_NAME_AS_IN_WEB_XML();

I imagine servlets and Jsp's are called in the same way. I hope this helps.

Re: Java - Servlet. Flasham
8/30/2004 7:52:42 AM
Hi!

Thank's for your answer. I'm try to do this, but it dos't work.
Re: Java - Servlet. icegoffy
9/8/2004 8:02:34 AM
From what i see in ur previous post:
===============================
on(release){
adminService.UserServlet();
}
================================
it should be :
on(release){
adminService.UserRequest();
}

AND ur : adminService = gatewayConnection.getService(???, this)

should be : adminService = gatewayConnection.getService("mm", this)

============================================================



Re: Java - Servlet. runnner
10/30/2004 6:05:33 AM
sorry,i want to ask if web.xml is in jrun4,who can tell me web.xml is in
"SERVER-INF\temp\gateway-webapp.war\WEB-INF\683173799" or in
"default-ear\default-war\WEB-INF\"

gatewayConnection.getService(???, this)

<servlet>
<servlet-name>MyServlet</servlet-name>
<display-name>MyServlet</display-name>
<description>Simple text servlet</description>
<servlet-class>MyServlet</servlet-class>
</servlet>

MyServlet.java

import javax.servlet.*;

import java.io.IOException;
import java.util.List;

public class MyServlet implements Servlet
{
private String message = null;

public void init(ServletConfig config) throws ServletException
{
message = "Hello from MyServlet";
}
public void service(ServletRequest request, ServletResponse response)
throws ServletException, IOException
{
//The args could be used here too...
/*
Object o = request.getAttribute("FLASH.PARAMS");
if (o instanceof List)
{
List args = (List)o;
}
Object arg0 = args.get(0);
Object arg1 = args.get(1);
*/
request.setAttribute("FLASH.RESULT", message);
}
public String getServletInfo()
{
return "A test servlet.";
}
public ServletConfig getServletConfig()
{
return null;
}
public void destroy()
{
message = null;
}
}

thanks
AddThis Social Bookmark Button