Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
Home
Discussion GroupsGeneralPHPASPPerlColdFusionFlashHTML, CSS, ScriptsBrowsers

Webmaster Forum / Flash / Flash Remoting / October 2004



Tip: Looking for answers? Try searching our database.

Java - Servlet.

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
Flasham - 27 Aug 2004 11:17 GMT
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
maliko50 - 27 Aug 2004 18:20 GMT
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.
Flasham - 30 Aug 2004 08:52 GMT
Hi!

   Thank's for your answer. I'm try to do this, but it dos't work.
   
icegoffy - 08 Sep 2004 09:02 GMT
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)

============================================================
runnner - 30 Oct 2004 07:05 GMT
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
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2009 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.