Hi friends
Here i have a sample Flex Application ;Wen I Click On the Button
request going through the struts.xml;so am unable to connecting to
the struts page;
its give an error page as "HTTP_REQUEST
Error "; am unable resolve that issue here;
can any body help on this issue ; am sending the sample code here ;
<?xml version="1.0" encoding="utf-8"?>
<mx:Application xmlns:mx="http://www.adobe.com/2006/mxml"
layout="absolute" minWidth="955" minHeight="600">
<mx:Script>
<![CDATA[
import mx.controls.Alert;
import mx.rpc.events.FaultEvent;
import mx.rpc.events.ResultEvent;
protected function
button1_clickHandler(event:MouseEvent):void
{
// TODO Auto-generated method stub
http.send();
}
protected function
http_resultHandler(event:ResultEvent):void
{
// TODO Auto-generated method stub
Alert.show("okkeva");
}
protected function
http_faultHandler(event:FaultEvent):void
{
// TODO Auto-generated method stub
Alert.show("False");
}
]]>
</mx:Script>
<mx:Button label="Click" click="button1_clickHandler(event)">
</mx:Button>
<mx:HTTPService id="http" useProxy="true" method="POST"
url="Login.action" resultFormat="object"
result="http_resultHandler(event)" fault="http_faultHandler(event)">
</mx:HTTPService>
</mx:Application>
=====================
Java Code Here
Struts.xml page :
<?xml version="1.0" encoding="UTF-8" ?>
<!DOCTYPE struts PUBLIC
"-//Apache Software Foundation//DTD Struts Configuration 2.0//EN"
"http://struts.apache.org/dtds/struts-2.0.dtd">
<struts>
<package name="com.tcs.login" extends="struts-default">
<action name="Login" class="com.tcs.login.crudAction">
<result name="success">last.jsp</result>
</action>
</package>
</struts>
===============
crudAction :
package com.tcs.login;
import java.util.ArrayList;
import java.util.Iterator;
import java.util.Map;
import javax.servlet.ServletContext;
import org.apache.struts2.ServletActionContext;
import org.apache.struts2.dispatcher.SessionMap;
import org.apache.struts2.interceptor.SessionAware;
import com.opensymphony.xwork2.ActionContext;
import com.opensymphony.xwork2.ActionSupport;
public class crudAction extends ActionSupport {
public String status;
public String execute()
{
status="success";
return status;
}
}
======================
web.xml
<?xml version="1.0" encoding="UTF-8"?>
<web-app id="WebApp_ID" version="2.4" xmlns="http://java.sun.com/xml/
ns/j2ee" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://java.sun.com/xml/ns/j2ee
http://java.sun.com/xml/ns/j2ee/web-app_2_4.xsd">
<display-name>stsExe</display-name>
<filter>
<filter-name>struts2</filter-name>
<filter-class>
org.apache.struts2.dispatcher.FilterDispatcher
</filter-class>
</filter>
<filter-mapping>
<filter-name>struts2</filter-name>
<url-pattern>/*</url-pattern>
</filter-mapping>
<welcome-file-list>
<welcome-file>new_server.html</welcome-file>
</welcome-file-list>
</web-app>
=======================================================
--
You received this message because you are subscribed to the Google Groups "Flex
India Community" 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/flex_india?hl=en.