Struts - How to use an ArrayList as a bean?

Dear Java Community,

I am using a very old version of struts - Jakarta Struts 1.1 b2 (The Version included in JDeveloper 10.1.2.1.0 for Java 1.4). I have to use this version of struts on the project I am working on because it is the only version compatible with our OC4J Container (Oracle Containers for Java) that runs on the version of our Oracle Application Server we use, that cannot be upgraded due to the reason that we run other programs that cannot be updated on it.

I am developing a form for orders to be entered in line by line in text fields. I have a button for the user to add more rows to this matrix of orders being entered. This dynamically generates <input type="text" name="somebean">. After the page submits it is mapped to action class myForm which extends the ActionForm class from the struts api. This form gets and sets beans.

I have a bean mapped in my struts config for testBox which maps to an ArrayList:

<form-bean name="myForm" type="org.apache.struts.action.ActionForm">

<form-property name="testBox" type="java.util.ArrayList"/>

</form-bean>

I have these as my getter and setter methods for the array:

public class myForm extends AcitonForm{

List testBox = new ArrayList();

public List getTestBox(){

return testBox;

}

public void setTestBox(List value){

testBox = value;

}

}

Now... here's the challenge. How do you configure this to catch the text fields in the ArrayList bean?

When you try to do this on your JSP page:

<input type="text" name="textBox[0]">

Tomcat will give you an array out of bounds index, which makes sense to me; however, I need to know how to enter in data to an ArrayList bean from a textbox. Is this even possible? If not by struts action mapping, could this be done by using AJAX? I do not know. I have spent three days trying to figure this solution out and googled to the end of the earth. I hope someone here can help because I am out of ideas.

Thank you,

Dantevios

[2081 byte] By [Danteviosa] at [2007-11-27 10:58:49]
# 1

fear not, this is definitely possible.

check out my response in this thread, http://forum.java.sun.com/thread.jspa?threadID=5174805 -- you are going to have to do something similar.

let me know how it's going and we can walk you through it.

den2681a at 2007-7-29 12:18:41 > top of Java-index,Enterprise & Remote Computing,Web Tier APIs...
# 2

I had a good look at your post and I thank you for your response, but I think the difference between the situation that you helped the other poster on is different from mine insomuch that I am not populating any Lists for my page beforehand in an Action class. I am familiar that you can use iterate to write beans that you have already made, but in my case the Action class is called after the page is submitted (when the ActionForm is called), not before. I am not trying to update any Lists that I have already populated. I am trying to have users enter in data to my form to be submitted and stored in an ArrayList bean so that I can then do validations on the ArrayList bean and send it to the model to have it write the order into the database.

The number of text fields I have can be dynamic, from 1 to infinity. I have no idea how many there are going to be on the page. The <input> fields will be added by javascript changing the innerHTML property of a div tag.

In your example you play around with a finite number of elements. The List bean you made knows how many checkboxes you have so that you can change them. In my example if I script a javascript that will generate <input name="testBox[0]"> <input name="testBox[1]"> How will my ArrayList know how to caputre these elements? It does not it gives me an index out of bounds error.

I see that you have used lazylists in your example. If I use lazylists as my list type will it automagically fix my problem?

Danteviosa at 2007-7-29 12:18:41 > top of Java-index,Enterprise & Remote Computing,Web Tier APIs...
# 3

yeah the example i showed you is a bit different but the fix is going to be more or less the same.

a lazylist will do what you need, namely it will be able to take some dynamic amount of data on the page (such as inputs 1 to N) and stuff them into a proper List object for you to process in your action class.

does the version of struts you are using support ActionClass and ActionForm -- if so i would use them instead of defining this form stuff inside struts-config.xml

give it a shot and let me know how it goes. just remember you'll want to create some type of Class which can hold the data in a line format and then just make sure you number your dynamic elements as WHATEVER[0] to WHATEVER[N] -- as that is the only way the lazylist will be able to properly load.

den2681a at 2007-7-29 12:18:41 > top of Java-index,Enterprise & Remote Computing,Web Tier APIs...
# 4

does the version of struts you are using support ActionClass and ActionForm -- if so i would use them instead of defining this form stuff inside struts-config.xml

Yes the version of struts I am using does support the "Action" class and ActionForm

Could you post an example of how to do this please? I do not know how to use beans in an ActionForm without putting them as a descriptor in struts-config.xml.

So far what I have come up with is I have an Action class that makes the list, the descriptor points to an ActionForm, then when the ActionForm submits it points to a different Action class. I get the feeling I am doing this wrong. Please help.

Thank you,

Dantevios

Danteviosa at 2007-7-29 12:18:41 > top of Java-index,Enterprise & Remote Computing,Web Tier APIs...
# 5

this will probably be easier to just show you and if you have questions about it, let me know.

first off, define the form and action in your struts-config.xml

<form-beans>

<form-bean name="YOUR_FORM_NAME" type="com.whatever.YOUR_FORM_CLASS"/>

</form-beans>

...

<action

path="YOUR_ACTION_PATH"

type="com.whatever.YOUR_ACTION_CLASS"

name="YOUR_FORM_NAME (from above)"

scope="request"

validate="true"

input="PATH_TO_YOUR_JSP_PAGE"

>

</action>

then create a form class like below, this must be the same class used in the form-bean part above...

public final class YOUR_FORM_CLASS extends ActionForm {

private List personList;

public List getPersonList() {

return personList;

}

public void setPersonList(List personList) {

this.personList = personList;

}

public void reset(ActionMapping actionMapping, HttpServletRequest httpServletRequest) {

personList = ListUtils.lazyList(new java.util.ArrayList(), new Factory() {

public Object create() { return new YOUR_LINE_DATA_CLASS(); }

});

}

}

then, in your jsp....

<input type="text" name="personList[0].fullName" value="joe smith">

<input type="text" name="personList[1].fullName" value="kevin johnson">

<input type="text" name="personList[2].fullName" value="art vandalay">

finally, in your action class...

YOUR_FORM_CLASS myForm = (YOUR_FORM_CLASS) form;

List personList = myForm.getPersonList();

if(personList != null) {

System.out.println("personList size = " + personList.size());

}

give that a shot and let me know how it goes.

den2681a at 2007-7-29 12:18:41 > top of Java-index,Enterprise & Remote Computing,Web Tier APIs...
# 6

I greatly appreciate all your help. I am still having one error though.

Here is the code from my side:

Struts-config.xml:

<form-beans>

<form-bean name="myTestForm" type="com.velcro.controller.myForm"/>

</form-beans>

<action

path="/myActionForm"

type="com.velcro.controller.myAction"

name="myTestForm"

scope="request"

validate="true"

input="/view/myForm.jsp"

>

</action>

myForm.java:

public class myForm extends ActionForm{

private List personList;

public List getPersonList() {

return personList;

}

public void setPersonList(List personList) {

this.personList = personList;

}

public void reset(ActionMapping actionMapping, HttpServletRequest httpServletRequest) {

personList = ListUtils.lazyList(new java.util.ArrayList(), new Factory() {

public Object create() { return new myBean(); }

});

}

}

myBean.java (MY_LINE_DATA):

public class myBean implements Serializable {

public myBean(){

super();

}

private List personList;

public List getPersonList() {

return personList;

}

public void setPersonList(List personList) {

this.personList = personList;

}

}

myAction.java:

public class myAction extends Action {

public ActionForward execute(ActionMapping mapping,

ActionForm form,

HttpServletRequest request,

HttpServletResponse response)

throws Exception {

myForm testForm = (myForm) form;

List personList = testForm.getPersonList();

return (mapping.findForward("myFormSuccess"));

}

}

/view/myForm.jsp (Significant lines only):

<html:form name="myTestForm" type="com.velcro.controller.myForm" action="/myActionForm">

<table border="0" width="100%">

<tr>

<td align="right">

<input type="text" name="personList[0].fullName"/>

</td>

</tr>

<tr>

<td align="right">

<html:submit value="Submit"/>

</td>

<td align="left">

<html:reset/>

</td>

</tr>

</table>

</html:form>

The problem I have found lies here in myAction.java:

myForm is (com.velcro.controller.myForm)

myForm testForm = (myForm) form;

List personList = testForm.getPersonList();

The error Tomcat gives me is:

javax.servlet.ServletException

org.apache.struts.action.RequestProcessor.processException(RequestProcessor.java:545)

org.apache.struts.action.RequestProcessor.processActionPerform(RequestProcessor.java:486)

org.apache.struts.action.RequestProcessor.process(RequestProcessor.java:274)

org.apache.struts.action.ActionServlet.process(ActionServlet.java:1482)

org.apache.struts.action.ActionServlet.doPost(ActionServlet.java:525)

javax.servlet.http.HttpServlet.service(HttpServlet.java:709)

javax.servlet.http.HttpServlet.service(HttpServlet.java:802)

root cause

java.lang.NullPointerException

com.velcro.controller.myAction.execute(Unknown Source)

org.apache.struts.action.RequestProcessor.processActionPerform(RequestProcessor.java:484)

org.apache.struts.action.RequestProcessor.process(RequestProcessor.java:274)

org.apache.struts.action.ActionServlet.process(ActionServlet.java:1482)

org.apache.struts.action.ActionServlet.doPost(ActionServlet.java:525)

javax.servlet.http.HttpServlet.service(HttpServlet.java:709)

javax.servlet.http.HttpServlet.service(HttpServlet.java:802)

If I try to use

List personList = (List)PropertyUtils.getSimpleProperty(form, "personList");

I get his error:

javax.servlet.ServletException: No bean specified

org.apache.struts.action.RequestProcessor.processException(RequestProcessor.java:545)

org.apache.struts.action.RequestProcessor.processActionPerform(RequestProcessor.java:486)

org.apache.struts.action.RequestProcessor.process(RequestProcessor.java:274)

org.apache.struts.action.ActionServlet.process(ActionServlet.java:1482)

org.apache.struts.action.ActionServlet.doPost(ActionServlet.java:525)

javax.servlet.http.HttpServlet.service(HttpServlet.java:709)

javax.servlet.http.HttpServlet.service(HttpServlet.java:802)

root cause

java.lang.IllegalArgumentException: No bean specified

org.apache.commons.beanutils.PropertyUtils.getSimpleProperty(PropertyUtils.java:1142)

com.velcro.controller.myAction.execute(Unknown Source)

org.apache.struts.action.RequestProcessor.processActionPerform(RequestProcessor.java:484)

org.apache.struts.action.RequestProcessor.process(RequestProcessor.java:274)

org.apache.struts.action.ActionServlet.process(ActionServlet.java:1482)

org.apache.struts.action.ActionServlet.doPost(ActionServlet.java:525)

javax.servlet.http.HttpServlet.service(HttpServlet.java:709)

javax.servlet.http.HttpServlet.service(HttpServlet.java:802)

The form is submitting correctly(Meaning it redirects to a page and I THINK stores the value in the personList list). myAction class is being called. This i can garuntee you cause I tested it; however, I cannot retrieve the personList List in myAction class for some reason.

Once again, I really appreciate all your help on this problem.

Thank you,

Dantevios

Danteviosa at 2007-7-29 12:18:42 > top of Java-index,Enterprise & Remote Computing,Web Tier APIs...
# 7

a few things i'm seeing wrong so far....

the myForm form class looks good, but your data class (myBean.java) has a personList in it, get rid of that part and just put a

private String fullName;

with setters and getters for now. this class (myBean.java) should have varibales for each input object you will have on the screen. the form class (myForm) will hold the List of these objects.

on your .jsp page inside the <html:form> tag get rid of the name and type part, just leave the action string.

i would focus on just getting the action to load and submit to itself for now. take out everything in your action class except that part that redirects back to itself. focus on just getting the .jsp page up and be able to click submit and have the page refresh again. we can move forward once that part is working.

let me know...

den2681a at 2007-7-29 12:18:42 > top of Java-index,Enterprise & Remote Computing,Web Tier APIs...
# 8

I didn't make the connection before with putting "private String fullName" and calling it in the jsp page, but that makes more sense now. This is in fact my very first Java web application I have ever written so please forgive me. I appreciate your patience. I did exactly what you said in your example before and even changed myBean.java to reflect your last post. I only added "name" and "type" to my <html:form> declaration because I thought that the syntax of my version of struts might be so old that some changes that got depricated in the struts-config.xml might not work with the <action> definition you gave me.

With the changes I made before adding "type" and "name" to my form, I had a form that could submit values and it was calling my aciton class correctly. I know this because it loaded a value into a database from it's execute class form different code I called. The error that I get when I try to do it as you listed in your example is:

exception

javax.servlet.ServletException: Cannot retrieve definition for form bean myTestForm

org.apache.jasper.runtime.PageContextImpl.doHandlePageException(PageContextImpl.java:825)

org.apache.jasper.runtime.PageContextImpl.handlePageException(PageContextImpl.java:758)

org.apache.jsp.view.myForm_jsp._jspService(myForm_jsp.java:89)

org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:94)

javax.servlet.http.HttpServlet.service(HttpServlet.java:802)

org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:324)

org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:292)

org.apache.jasper.servlet.JspServlet.service(JspServlet.java:236)

javax.servlet.http.HttpServlet.service(HttpServlet.java:802)

root cause

javax.servlet.jsp.JspException: Cannot retrieve definition for form bean myTestForm

org.apache.struts.taglib.html.FormTag.lookup(FormTag.java:831)

org.apache.struts.taglib.html.FormTag.doStartTag(FormTag.java:506)

org.apache.jsp.view.myForm_jsp._jspx_meth_html_form_0(myForm_jsp.java:197)

org.apache.jsp.view.myForm_jsp._jspx_meth_html_html_0(myForm_jsp.java:125)

org.apache.jsp.view.myForm_jsp._jspService(myForm_jsp.java:80)

org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:94)

javax.servlet.http.HttpServlet.service(HttpServlet.java:802)

org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:324)

org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:292)

org.apache.jasper.servlet.JspServlet.service(JspServlet.java:236)

javax.servlet.http.HttpServlet.service(HttpServlet.java:802)

note

This is what I get when I did exactly what you said to do in your example and have just private String fullname and it's setter and getter methods properly defined in myBean.java.

I tried adding <form-bean name="personList" type="java.util.List"> to struts-config.xml, but I havn't had any luck.

Thanks,

Dantevios

Danteviosa at 2007-7-29 12:18:42 > top of Java-index,Enterprise & Remote Computing,Web Tier APIs...
# 9

do NOT put this in your struts-config.xml

<form-bean name="personList" type="java.util.List">

the only things that should really be in there are your form declarations and your action mappings.

if you can get the page to work by having the "type" and "name" attributes in your <html:form> tag, then by all means put them back in. if they are in there and you can get the page to submit to itself and reload then we are almost done.

at that point trying checking the personList object of the form again in your action class and let me know how it goes or if you get errors.

i'll check back tomorrow and see how it's going.

den2681a at 2007-7-29 12:18:42 > top of Java-index,Enterprise & Remote Computing,Web Tier APIs...
# 10

<form-bean name="personList" type="java.util.List">

This is not in my struts-config.xml, I took it out.

I added the "type" and "name" back into my <html:form> tag and the page does load, but the form does not submit correctly. The error I am getting which I posted before when my configuration was like this (where everything is just as you said in your example, but with the "type" and "name added to <html:form>) is:

javax.servlet.ServletException

org.apache.struts.action.RequestProcessor.processException(RequestProcessor.java:545)

org.apache.struts.action.RequestProcessor.processActionPerform(RequestProcessor.java:486)

org.apache.struts.action.RequestProcessor.process(RequestProcessor.java:274)

org.apache.struts.action.ActionServlet.process(ActionServlet.java:1482)

org.apache.struts.action.ActionServlet.doPost(ActionServlet.java:525)

javax.servlet.http.HttpServlet.service(HttpServlet.java:709)

javax.servlet.http.HttpServlet.service(HttpServlet.java:802)

root cause

java.lang.NullPointerException

com.velcro.controller.myAction.execute(Unknown Source)

org.apache.struts.action.RequestProcessor.processActionPerform(RequestProcessor.java:484)

org.apache.struts.action.RequestProcessor.process(RequestProcessor.java:274)

org.apache.struts.action.ActionServlet.process(ActionServlet.java:1482)

org.apache.struts.action.ActionServlet.doPost(ActionServlet.java:525)

javax.servlet.http.HttpServlet.service(HttpServlet.java:709)

javax.servlet.http.HttpServlet.service(HttpServlet.java:802)

--

In myAction.java when I comment out this line it submits correctly:

myAction.java:

public class myAction extends Action {

public ActionForward execute(ActionMapping mapping,

ActionForm form,

HttpServletRequest request,

HttpServletResponse response)

throws Exception {

myForm testForm = (myForm) form;

//List personList = testForm.getPersonList();

return (mapping.findForward("myFormSuccess"));

}

}

--

So I know it cannot retrive the beans it is submitting, but I have no clue why that is.

Danteviosa at 2007-7-29 12:18:42 > top of Java-index,Enterprise & Remote Computing,Web Tier APIs...
# 11

sounds right, the form is not getting submitted for some reason. try adding a System.out.println() and check if the ActionForm "form" is null inside the Action class. Also, add a another debug print inside the reset() function in your form bean, and see if it is ever getting called.

it seems like it's a configuration issue, if it's not to much trouble can you post the your code again for you struts-config, jsp page, and all your java classes. maybe then i can see what the problem is.

den2681a at 2007-7-29 12:18:42 > top of Java-index,Enterprise & Remote Computing,Web Tier APIs...
# 12

I'm not using any IDE's or anything so putting a System.out.println() statement in my code doesn't show me anything, no matter where I put it. Instead I connect to my database and insert a String into a table cell whenever I want to prompt for a value. The results of the tests you asked about in your post are: When I tried to write ActionForm variable form.toString() into the database I was given a Null Pointer Exception by tomcat.

I put an insert into the database statement in the reset function of myForm.java. I can see the value got inserted right when the page loads before I click the button. After I click the button it does not insert the string. After I reload the page it does not insert the value again.

My code is the same as in the post I have posted before (except the changes to myBean.java to add private String fullname and it's getter and setters) but here it is reposted:

Struts-config.xml:

<form-beans>

<form-bean name="myTestForm" type="com.velcro.controller.myForm"/>

</form-beans>

<action

path="/myActionForm"

type="com.velcro.controller.myAction"

name="myTestForm"

scope="request"

validate="true"

input="/view/myForm.jsp"

>

</action>

myForm.java:

public class myForm extends ActionForm{

private List personList;

public List getPersonList() {

return personList;

}

public void setPersonList(List personList) {

this.personList = personList;

}

public void reset(ActionMapping actionMapping, HttpServletRequest httpServletRequest) {

personList = ListUtils.lazyList(new java.util.ArrayList(), new Factory() {

public Object create() { return new myBean(); }

});

}

}

myBean.java (MY_LINE_DATA):

public class myBean implements Serializable {

public myBean(){

super();

}

private String fullName;

public String getFullName(){

return fullName;

}

public void setFullname(String value){

fullName = value;

}

return personList;

}

public void setPersonList(List personList) {

this.personList = personList;

}

}

myAction.java:

public class myAction extends Action {

public ActionForward execute(ActionMapping mapping,

ActionForm form,

HttpServletRequest request,

HttpServletResponse response)

throws Exception {

myForm testForm = (myForm) form;

List personList = testForm.getPersonList();

return (mapping.findForward("myFormSuccess"));

}

}

/view/myForm.jsp (Significant lines only):

<html:form name="myTestForm" type="com.velcro.controller.myForm" action="/myActionForm">

<table border="0" width="100%">

<tr>

<td align="right">

<input type="text" name="personList[0].fullName"/>

</td>

</tr>

<tr>

<td align="right">

<html:submit value="Submit"/>

</td>

<td align="left">

<html:reset/>

</td>

</tr>

</table>

</html:form>

Once again, I appreciate all your help.

Thanks,

Dantevios

Danteviosa at 2007-7-29 12:18:42 > top of Java-index,Enterprise & Remote Computing,Web Tier APIs...
# 13

ok, i think i see the issue now. in your ActionClass, change

return (mapping.findForward("myFormSuccess"));

to

return (mapping.getInput());

den2681a at 2007-7-29 12:18:42 > top of Java-index,Enterprise & Remote Computing,Web Tier APIs...
# 14

I get this as a compiler error when i try to ANT it:

[javac] /home/nox/workspace/jakartastruts/listtest/WEB-INF/src/java/com/velcro/controller/myAction.java:35: incompatible types

[javac] found: java.lang.String

[javac] required: org.apache.struts.action.ActionForward

[javac] return (mapping.getInput());

[javac] ^

[javac] 1 error

Danteviosa at 2007-7-29 12:18:42 > top of Java-index,Enterprise & Remote Computing,Web Tier APIs...
# 15

I tried using

return (mapping.getInputForward()) instead, but that gives me this error still (which is the same error caused by List personList = testForm.getPersonList():

javax.servlet.ServletException

org.apache.struts.action.RequestProcessor.processException(RequestProcessor.java:545)

org.apache.struts.action.RequestProcessor.processActionPerform(RequestProcessor.java:486)

org.apache.struts.action.RequestProcessor.process(RequestProcessor.java:274)

org.apache.struts.action.ActionServlet.process(ActionServlet.java:1482)

org.apache.struts.action.ActionServlet.doPost(ActionServlet.java:525)

javax.servlet.http.HttpServlet.service(HttpServlet.java:709)

javax.servlet.http.HttpServlet.service(HttpServlet.java:802)

root cause

java.lang.NullPointerException

com.velcro.controller.myAction.execute(Unknown Source)

org.apache.struts.action.RequestProcessor.processActionPerform(RequestProcessor.java:484)

org.apache.struts.action.RequestProcessor.process(RequestProcessor.java:274)

org.apache.struts.action.ActionServlet.process(ActionServlet.java:1482)

org.apache.struts.action.ActionServlet.doPost(ActionServlet.java:525)

javax.servlet.http.HttpServlet.service(HttpServlet.java:709)

javax.servlet.http.HttpServlet.service(HttpServlet.java:802)

Danteviosa at 2007-7-29 12:18:47 > top of Java-index,Enterprise & Remote Computing,Web Tier APIs...
# 16

sorry, try this

return new ActionForward(mapping.getInput());

den2681a at 2007-7-29 12:18:47 > top of Java-index,Enterprise & Remote Computing,Web Tier APIs...
# 17

No problem. I tried that, but I still get the same error:

javax.servlet.ServletException

org.apache.struts.action.RequestProcessor.processException(RequestProcessor.java:545)

org.apache.struts.action.RequestProcessor.processActionPerform(RequestProcessor.java:486)

org.apache.struts.action.RequestProcessor.process(RequestProcessor.java:274)

org.apache.struts.action.ActionServlet.process(ActionServlet.java:1482)

org.apache.struts.action.ActionServlet.doPost(ActionServlet.java:525)

javax.servlet.http.HttpServlet.service(HttpServlet.java:709)

javax.servlet.http.HttpServlet.service(HttpServlet.java:802)

root cause

java.lang.NullPointerException

com.velcro.controller.myAction.execute(Unknown Source)

org.apache.struts.action.RequestProcessor.processActionPerform(RequestProcessor.java:484)

org.apache.struts.action.RequestProcessor.process(RequestProcessor.java:274)

org.apache.struts.action.ActionServlet.process(ActionServlet.java:1482)

org.apache.struts.action.ActionServlet.doPost(ActionServlet.java:525)

javax.servlet.http.HttpServlet.service(HttpServlet.java:709)

javax.servlet.http.HttpServlet.service(HttpServlet.java:802)

Danteviosa at 2007-7-29 12:18:47 > top of Java-index,Enterprise & Remote Computing,Web Tier APIs...
# 18

i'm starting to run out of ideas now, but try setting validate="false" (instead of what is there now, validate="true") inside your struts-config.xml for your ActionMapping.

make sure you close everything and start it up again every time you change struts-config.xml.

den2681a at 2007-7-29 12:18:47 > top of Java-index,Enterprise & Remote Computing,Web Tier APIs...
# 19

Yeah I'm pretty much out of ideas too after troubleshooting this for 4 days, but my project can't move forward without this. Have you ever done this before in struts the way you have explained it? If so do you know what version you were using? I tried switching to struts 1.3.8 (just to see if it was a version problem), but nothing happens in my execute class when I try to write to the database. Strangely it still forwards me to the other page correctly though.

Danteviosa at 2007-7-29 12:18:47 > top of Java-index,Enterprise & Remote Computing,Web Tier APIs...
# 20

yes, this is definitely possibly and has been done by people thousands of times before.

post your email address -- i'll send you a note and you can email me your code to look at, it's to hard to review on these boards.

den2681a at 2007-7-29 12:18:47 > top of Java-index,Enterprise & Remote Computing,Web Tier APIs...
# 21

My email address is dantevios@gmail.com, i'll send you a war with the source in it. If you have an application you know works that does this already I would appreciate it if you sent an example to me.

Thank you so much,

Dantevios

Danteviosa at 2007-7-29 12:18:47 > top of Java-index,Enterprise & Remote Computing,Web Tier APIs...