Newsgroup: it.comp.java
Titolo: Aiuto Struts!

Ciao a tutti.
Come posso fare a passare un array String[] ad una DynaActionForm?
Ottengo la seguente Exception
Grazie in anticipo!!!!
javax.servlet.ServletException: Invalid property name 'userdata'
 org.apache.struts.action.RequestProcessor.processException(RequestProcessor.java:523) org.apache.struts.action.RequestProcessor.processActionPerform(RequestProcessor.java:421) org.apache.struts.action.RequestProcessor.process(RequestProcessor.java:224) org.apache.struts.action.ActionServlet.process(ActionServlet.java:1196) org.apache.struts.action.ActionServlet.doPost(ActionServlet.java:432) javax.servlet.http.HttpServlet.service(HttpServlet.java:709) javax.servlet.http.HttpServlet.service(HttpServlet.java:802)root causejava.lang.IllegalArgumentException: Invalid property name 'userdata' org.apache.struts.action.DynaActionForm.getDynaProperty(DynaActionForm.java:603) org.apache.struts.action.DynaActionForm.get(DynaActionForm.java:194) org.apache.struts.action.DynaActionForm.getStrings(DynaActionForm.java:327) com.openshare.controller.action.UserValidation.execute(UserValidation.java:47) org.apache.struts.action.RequestProcessor.processActionPerform(RequestProcessor.java:419) org.apache.struts.action.RequestProcessor.process(RequestProcessor.java:224) org.apache.struts.action.ActionServlet.process(ActionServlet.java:1196) org.apache.struts.action.ActionServlet.doPost(ActionServlet.java:432) javax.servlet.http.HttpServlet.service(HttpServlet.java:709) javax.servlet.http.HttpServlet.service(HttpServlet.java:802)Ecco i componeti del mio sistema:-----------------------Struts-config: ------------------------<?xml version="1.0" encoding="ISO-8859-1" ?><!DOCTYPE struts-config PUBLIC"-//Apache Software Foundation//DTD Struts Configuration 1.2//EN""
http://jakarta.apache.org/struts/dtds/struts-config_1_2.dtd
"><struts-config><form-beans><form-bean name="UserFormBean"type="org.apache.struts.action.DynaActionForm" dynamic="true" /><form-property name="userdata" type="java.lang.String[]"/></form-beans><action-mappings><action path="/login"type="com.openshare.controller.action.UserValidation"name="UserFormBean" scope="request"><forward name="success" path="/Index.jsp" /><forward name="fault" path="/Retry.jsp" /></action></action-mappings></struts-config>---------------------UserValidation.java -----------------------------------------package com.openshare.controller.action;import java.sql.*;import java.util.Vector;import com.openshare.model.sql.*;import com.openshare.bean.form.*;import javax.servlet.http.*;import org.apache.struts.action.*;public class UserValidation extends Action{//    Connection con;    public SQLConnection sqlc = new SQLConnection();    String password;    int j;    StringBuffer buffer = new StringBuffer(100);   // public Status syst = new Status();    public String server = "";    public String user = "";    public String database ="";public ActionForward execute (ActionMapping mapping, ActionForm form,                              HttpServletRequest request,HttpServletResponse response)throws Exception{ DynaActionForm dynaForm = (DynaActionForm)form; //sqlc.userdata  = request.getParameterValues("userdata"); sqlc.userdata = (String[])dynaForm.getStrings("userdata"); sqlc.makeConnection(); String result; if (getValidation()) result = "success" ; else result = "fault";return mapping.findForward(result);}public boolean getValidation(){  return sqlc.validation; } public String getMessage(){  System.out.println(sqlc.message);      return sqlc.message;    }    }

Non si capisce quasi nulla perchè è saltata la formattazione del
testo ma, mi sembra tu abbia postato la Action anzichè il Form.
E comunque non mi pare tanto un problema di struttura dati quanto di
naming.