Home Tutorials Forums Articles Blogs Movies Library Employment Press
Prev Previous Post   Next Post Next
Old 03-22-2005, 01:25 PM   #1
snapple
member
 
snapple's Avatar
 
Join Date: Feb 2002
Location: London
Posts: 2,442
Default Java / web.xml Remoting problem

Hello. Thanks in advance for any help or advice.

I am using; Java 1.5, Tomcat 5.5, openamf, fmx 2004 pro.

I bought "Flash Remoting, the definitive guide by Tom Muck". However, most documentation directly relates to the bought version of Flash Remoting and JRun 4. So i am having a little trouble getting things working myself.

I have actually got some remoting to work in Flash, a simple HelloWorld example. However, i only got this working by actually puting and compiling my Java class inside openamf (the following directory structure):

Tomcat
------->Tomcat 5.5
-------------------->webapps
------------------------------>openamf
---------------------------------------->WEB-INF
-------------------------------------------------->classes

This worked. However, from what i understand, this is not how it should acuatlly be achieved. What i should actually have (i think) is, my own completely self-contained webapp, and point it to the remoting gateway.

So what i did was:

1) Copy openamf.jar file into the lib directory of my webapp.
2) add the following XML to my own webapps web.xml file (inside WE-INF).

Quote:

<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE web-app
PUBLIC "-//Sun Microsystems, Inc.//DTD Web Application 2.2//EN"
"http://java.sun.com/j2ee/dtds/web-app_2.2.dtd">
<web-app>

<servlet>
<servlet-name>foo</servlet-name> <!-- mapping name below -->
<servlet-class>ByeByeWorld</servlet-class> <!-- name of class -->
</servlet>
<servlet-mapping>
<servlet-name>foo</servlet-name> <!-- finds same name above and looks up the class -->
<url-pattern>/ByeByeWorld</url-pattern> <!-- the url that can be typed in the browser -->
</servlet-mapping>
<!-- this is what i added -->

<servlet>
<servlet-name>FlashGatewayServlet</servlet-name>
<servlet-class>../openamf/gateway</servlet-class><!-- HOW DO I GET INTO OEPNAMF FROM HERE? -->
</servlet>
<servlet-mapping>
<servlet-name>FlashGatewayServlet</servlet-name>
<url-pattern>/gateway</url-pattern>
</servlet-mapping>

</web-app>

Area of confusion...

How come i can type http://localhost/openamf/gateway into my browser and it (as it should do) return a blank page (Where is the gateway, i can't see anything directly relating to it inside the openamf servlet?) Secondly, inside the <servlet-class></servlet-class> tag, is this what points to the actual remoting gateway, is this what makes remoting work and hence i should 'point' my webapp to it?

My main question is:

What goes inside the <servlet-class></servlet-class> tags that are meant to find the remtoing gateway, inside my webapps web.xml? (assuming i already have the other <servlet-class> tags set-up to point to the actual Java class that i wrote) ?

Massive thanks for any help, really is appreciated.

Regards, snapple

Last edited by snapple; 03-22-2005 at 03:19 PM.
snapple is offline   Reply With Quote
 


Thread Tools
Display Modes Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off

Forum Jump


All times are GMT. The time now is 02:23 PM.

///
Follow actionscriptorg on Twitter

 


Powered by vBulletin® Version 3.8.5
Copyright ©2000 - 2014, Jelsoft Enterprises Ltd.
Ad Management plugin by RedTyger
Copyright 2000-2013 ActionScript.org. All Rights Reserved.
Your use of this site is subject to our Privacy Policy and Terms of Use.