RE: Dynamic Form Beans?

2001-09-06 Thread Tuscano, Stephen

Hi John,

  Are you able to slove this problem?if so, Can you help me out?

Stephen.


> -Original Message-
> From: John Townsend [SMTP:[EMAIL PROTECTED]]
> Sent: Wednesday, August 29, 2001 8:19 PM
> To:   [EMAIL PROTECTED]; 'Luis Olivares'
> Subject:  RE: Dynamic Form Beans?
> 
> The one idea that I had was to create a new subclass of ActionForm
> called ActionDataForm. This form would have get and put methods that use
> keys instead of the usual pattern of numerous getters/setters. 
>  
> 
> For the process of saving form data, we could add a new override to
> RequestUtils.processPopulate(..) which would take an ActionDataForm
> instead of an ActionForm as its form instance. Then we would implement
> this method to use get and put with keys instead of getters/setters.
> 
> One problem: I don't know how the populate works from the other side
> (meaning when you want to prepopulate a form based on the contents of a
> JavaBean in the session, etc.). I imagine that logic is contained in the
> HTML tag libraries or some other tag library.
> 
> I guess what I am wondering is that since a number of people have run
> into this and needed a solution I assumed that there might already be a
> solution to this problem. If not, maybe we can find a solution and then
> submit a patch to Struts for 1.1 or something.
> 
> Anyone else have any thoughts on this?
> 
> -- John Townsend
> 
> PS. One thing I just thought of: I wonder if there is a JavaBeans
> solution to this problem? If there is, that might be a better way to go.
> 
> 
> -Original Message-
> From: Luis Olivares [mailto:[EMAIL PROTECTED]] 
> Sent: Wednesday, August 29, 2001 11:28 AM
> To: [EMAIL PROTECTED]
> Subject: Re: Dynamic Form Beans?
> 
> I have the same 'problem'.
> 
> I would like to be able to create a form dynamically depending on the
> structure of a table (I used to do this with 'plain' JSP).
> Any ideas?
> 
> Regards.
>Luis Olivares.
>[EMAIL PROTECTED]
>--
>   "Intelligence is the ability to avoid doing
>work, yet getting the work done"
>   --Linus Torvalds--
> 
> - Original Message -
> From: "John Townsend" <[EMAIL PROTECTED]>
> To: <[EMAIL PROTECTED]>
> Sent: Wednesday, August 29, 2001 12:54 PM
> Subject: Dynamic Form Beans?
> 
> 
> > I am working on a project where is would be nice to have the ability
> to
> > define a dynamic form bean (i.e. a form bean where the fields are
> > defined at runtime). The most obvious (but perhaps not the best)
> > solution to this problem would be if the ActionServlet could handle
> > saving data in a form bean that was a hashtable.
> >
> > Has someone else run into this problem and come up with a solution?
> >
> > Thanks,
> > -- John Townsend
> >



RE: ActionForm -> HashMap.

2001-09-05 Thread Tuscano, Stephen

Hi,
  can anybody help me out in converting ActionForm to HashMap. There is a
Method called "describe" available is org.apache.struts.util.Beanutil, which
converts the action form into Map.But for this you need to create form-bean
for each jsp.
 I want generic form-bean, which should hold actionform data and then
convert to map.


Thanxs.
Stephen.





RE: Struts Question

2001-06-25 Thread Tuscano, Stephen

Charles,

This is a known problem.  Websphere has a bug (inherited from the old
version of Tomcat they used) that does not remove attributes from request
scope, even though this is perfectly legal.

Until Websphere fixes this, the only solution is to remove two lines from
the doEndTag() method (the two "pageContext.removeAttribute()" calls) and
rebuild Struts.

Stephen.

> -Original Message-
> From: Rick Smith [SMTP:[EMAIL PROTECTED]]
> Sent: Friday, June 22, 2001 11:41 PM
> To:   [EMAIL PROTECTED]
> Subject:  Re: Struts Question
> 
> Charles, 
> 
> I ran into the same problem trying to run struts on Tomcat 3.1. Removing
> attributes isn't supported in the older jsp specification or something
> like that. Try running the test page using Tomcat 3.2 if you can. 
> 
> Rick 
> 
> Charles Baker wrote:
> > 
> > Quick question,
> > I?m using VA ?s Web Test  Env and I?m getting an error using a
> simple test
> > page from the IBM web site. I?m still new to Struts so can someone let
> me
> > know if this is a simple mistake that I?m making? The single page JSP
> and
> > full error message are following.
> > Message: Server caught unhandled exception from servlet [jsp]: cant
> remove
> > Attributes from request scope
> > 
> > Thanks in advance for any help.
> > CEB
> > 
> > JSP Page
> > %@taglib uri="/WEB-INF/struts-html.tld" prefix="html"%
> > 
> > 
> > 
> > *First Name: 
> > *Last Name: 
> > *Phone Number: 
> > Office Number: 
> > Backup: 
> > Backup Phone Number: 
> > 
> > 
> > 
> > 
> > Error 500
> > An error has occured while processing
> > request:http://localhost:8080/employeelist/processNewEmployee.do
> > Message: Server caught unhandled exception from servlet [action]: Server
> > caught unhandled exception from servlet [jsp]: cant remove Attributes
> from
> > request scope
> > 
> > Target Servlet: action
> > StackTrace:
> > 
> > Root Error-1: cant remove Attributes from request scope
> > java.lang.IllegalArgumentException: cant remove Attributes from request
> > scope java.lang.Throwable(java.lang.String)
> > java.lang.Exception(java.lang.String)
> > java.lang.RuntimeException(java.lang.String)
> > java.lang.IllegalArgumentException(java.lang.String) void
> >
> org.apache.jasper.runtime.PageContextImpl.removeAttribute(java.lang.String
> ,
> > int) int org.apache.struts.taglib.html.FormTag.doEndTag() void
> >
> jsp._employeeEdit_xjsp._jspService(javax.servlet.http.HttpServletRequest,
> > javax.servlet.http.HttpServletResponse) void
> >
> org.apache.jasper.runtime.HttpJspBase.service(javax.servlet.http.HttpServl
> etRequest,
> > javax.servlet.http.HttpServletResponse) void
> > javax.servlet.http.HttpServlet.service(javax.servlet.ServletRequest,
> > javax.servlet.ServletResponse) void
> >
> org.apache.jasper.runtime.JspServlet$JspServletWrapper.service(javax.servl
> et.http.HttpServletRequest,
> > javax.servlet.http.HttpServletResponse, boolean) void
> >
> org.apache.jasper.runtime.JspServlet.serviceJspFile(javax.servlet.http.Htt
> pServletRequest,
> > javax.servlet.http.HttpServletResponse, java.lang.String,
> > java.lang.Throwable, boolean) void
> >
> org.apache.jasper.runtime.JspServlet.service(javax.servlet.http.HttpServle
> tRequest,
> > javax.servlet.http.HttpServletResponse) void
> > javax.servlet.http.HttpServlet.service(javax.servlet.ServletRequest,
> > javax.servlet.ServletResponse) void
> >
> com.ibm.servlet.engine.webapp.StrictServletInstance.doService(javax.servle
> t.ServletRequest,
> > javax.servlet.ServletResponse) void
> >
> com.ibm.servlet.engine.webapp.StrictLifecycleServlet._service(javax.servle
> t.ServletRequest,
> > javax.servlet.ServletResponse) void
> >
> com.ibm.servlet.engine.webapp.ServicingServletState.service(com.ibm.servle
> t.engine.webapp.StrictLifecycleServlet,
> > javax.servlet.ServletRequest, javax.servlet.ServletResponse) void
> > com.ibm.servlet.engine.webapp.StrictLifecycleServlet.service
> > 
> > _
> > Get your FREE download of MSN Explorer at http://explorer.msn.com