Adobe Dreamweaver Forums



Last 10 THreads :         DW CS4 - Internet Explorer - Tables (Last Post : billhdz - Replies : 0 - Views : 1 )           »          Property inspector (Last Post : Murray *ACE* - Replies : 1 - Views : 2 )           »          Mail form not working (Last Post : Gary White - Replies : 4 - Views : 5 )           »          How do I change the order the pictures are in when doinga web photo album? (Last Post : Nancy O - Replies : 1 - Views : 2 )           »          Hacked Possible through local machine (Last Post : Coldstream - Replies : 15 - Views : 40 )           »          Re: Robohelp HTML Not Compiling and not responding (Last Post : glennito - Replies : 0 - Views : 1 )           »          datagrid in a datagrid (Last Post : nickname118 - Replies : 4 - Views : 7 )           »          special chars in XML (Last Post : ilux - Replies : 0 - Views : 1 )           »          TextArea: Interface for user selection is deficient (Last Post : ericbelair - Replies : 2 - Views : 3 )           »          Lost resorce on Adobe.com (Last Post : tweaked_eye - Replies : 1 - Views : 2 )           »         


Home Register FAQ Members List Calendar Search Today's Posts Mark Forums Read
User Info Statistics
Go Back   Adobe Dreamweaver Forums > Other Macromedia/Adobe Products > Flex
 
Tags: ,



Reply
  #1 (permalink)  
Old 08-26-2008, 01:54 PM
edeewan
 
Posts: n/a
Diggs:
Default Flex with JSP

Hi All,
am new to Flex.Here is the simple scenario that am not able to make
it work, how to get the values from the form(from MXML file) in JSP and
validating the form(for manadatory fields) and storing those values in
database and getting those details back and diaplaying with the MXML file.

Thanks in Advance.




Reply With Quote
Sponsored Links
  #2 (permalink)  
Old 08-27-2008, 05:41 AM
JB2622
 
Posts: n/a
Diggs:
Default Re: Flex with JSP

This link might help
http://flex.sys-con.com/node/318939
Reply With Quote
  #3 (permalink)  
Old 08-27-2008, 10:26 AM
edeewan
 
Posts: n/a
Diggs:
Default Re: Flex with JSP

Hi,

Thanks for your help JB2622 .

Earlier also i got the same example from the net but
in that just they mentioned the file name. Now after deploying that file in the
Tomcat server and changing the URL

employee.jsp to http://localhost:8080/employee.jsp

it is working fine now.




Reply With Quote


  #4 (permalink)  
Old 08-27-2008, 02:44 PM
JB2622
 
Posts: n/a
Diggs:
Default Re: Flex with JSP

You should not have to use the whole URL. Have you tried "/employee.jsp"?
Reply With Quote
  #5 (permalink)  
Old 08-28-2008, 02:11 PM
sankar83
 
Posts: n/a
Diggs:
Default Re: Flex with JSP

Hi JB2622,

As u said i tried but it's not working. If you won't give entire location of the file how the compiler will know?
Reply With Quote
  #6 (permalink)  
Old 08-28-2008, 03:43 PM
JB2622
 
Posts: n/a
Diggs:
Default Re: Flex with JSP

sankar83

Maybe we are not talking about the same thing. The jsp page that I'm
referring to is included with my Flex application. The following syntax works
when I call the jsp page from this Flex application:

navigateToURL(new URLRequest("/DataExportExample/jsp/downloadCSV.jsp "),
"_blank");

The "DataExportExample" is the context root of the application. I have also
called a jsp without the context root:
navigateToURL(new URLRequest("jsp/downloadCSV.jsp"), "_blank");



Reply With Quote


  #7 (permalink)  
Old 08-29-2008, 05:26 AM
sankar83
 
Posts: n/a
Diggs:
Default Re: Flex with JSP

Hi JB2622,

Ok, right now am comfortable with your eariler suggestion and i will try
with navigateToURL later since am new to flex and i have one more problem and i
think you will solve this problem

here is the scenario , am trying to connect to the my-sql database and get the
data from the DB in the JSP page ( employee.jsp) and trying to displaying those
records through the MXML using the DataGrid as shown in the following code

I have deployed that employee.jsp in the Tomcat Server and am able to display
those recoeds(http://localhost:8080/employee.jsp in the browser), but the
problem is am not able to display those records through the MXML.


sample.mxml

<?xml version="1.0" encoding="utf-8"?>
<mx:Application xmlns:mx="http://www.adobe.com/2006/mxml" layout="absolute"
initialize="emp.send()">

<!--<mx:Script>
<![CDATA[
private function onResult(event:Event):void
{
return;
}
]]>
</mx:Script>-->

<mx:HTTPService id="emp" method="POST"
url="http://localhost:8080/employee.jsp"/>

<mxataGrid dataProvider="{emp.lastResult.employees.employee}" x="100"
y="100">
<mx:columns>
<mxataGridColumn dataField="firstname" headerText="First Name"/>
<mxataGridColumn dataField="lastname" headerText="Last Name"/>
<mxataGridColumn dataField="age" headerText="Age"/>
<mxataGridColumn dataField="designation" headerText="Designation"/>
</mx:columns>
</mxataGrid>

</mx:Application>


employee.jsp


<%@ page language="java" contentType="text/html; charset=UTF-8"
pageEncoding="UTF-8"%>
<%@ page import="java.sql.*" %>
<employees>
<%
try
{
Class.forName("com.mysql.jdbc.Driver");
Connection
con=DriverManager.getConnection("jdbc:mysql://loca lhost:3306/sankar","root","san
kar");
out.println("Successfully connected to my-sql <br>");

Statement stmt=con.createStatement();
ResultSet rs=stmt.executeQuery("select * from employee");
while(rs.next())
{
%>

<employee>
<firstname><%= rs.getString(1) %></firstname>
<lastname><%= rs.getString(2) %></lastname>
<age><%= rs.getString(3) %></age>
<designation><%= rs.getString(4) %></designation>
</employee>

<% }

con.close();

}
catch(Exception e)
{
System.out.println("Exception due to:"+e);
}
%>
</employees>



Reply With Quote
  #8 (permalink)  
Old 08-29-2008, 01:16 PM
sankar83
 
Posts: n/a
Diggs:
Default Re: Flex with JSP

Hi JB2622,

myself find the solution.The change is simple thing only that is change the


contentType="text/html" to contentType="text/xml" in the employee.jsp

then it will work fine.
Reply With Quote
  #9 (permalink)  
Old 08-29-2008, 01:44 PM
curious_Lee
 
Posts: n/a
Diggs:
Default Re: Flex with JSP

You can also use a servlet with your Flex app, though setting the paths up in
your web.xml can be tricky. I just finished doing that for a project. Here's
one example of a servlet for a Flex app:
http://blog.kevinhoyt.org/2007/12/07...t-file-upload/

If you look further down that linked page, you'll see a link to the source
code.

Reply With Quote


Reply


Thread Tools
Display Modes

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

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On



© Camley Interactive (camley.info) 2008 - all logos and images are copywrite their respective owners.
Proud member of the Camley Interactive Network
All times are GMT. The time now is 05:14 PM.


Powered by vBulletin® Version 3.6.8
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
Search Engine Friendly URLs by vBSEO 3.1.0 ©2007, Crawlability, Inc.
Inactive Reminders By Mished.co.uk