iPlanet and poolman

2002-03-05 Thread alberto bolchini

Hi all.

We developed a webapp using struts/poolman/log4j/dbforms on Tomcat4.0 on 
Linux w/ PostgreSQL. Everything works fine on that configuration.
We are now trying to run the app on an installation of iPlanet Web 
Server 6.0SP2 on Windows, using PostgreSQL on the same box (under cygwin).
The installation of the db works fine, the webapp war gets deployed but 
the web server restarts without logging anything on the call to 
findDataSource of Poolman.
Is anybody experiencing something similar?

Thanx.
alberto


--
To unsubscribe, e-mail:   
For additional commands, e-mail: 




Re: performance over iterate

2002-02-11 Thread Alberto Bolchini

Hi Arron.

I am aware of Netscape's idiosyncrasy for nested tables, and as the code
snippet showed, I just used one table, playing around w/ colspans.
Actually my Leaf would eventually return a _null_ on the getChildren
method thus breaking the nested iterator. Returning an empty array and
taking away all of the  really made the difference.

Thanks.
a.

--
To unsubscribe, e-mail:   
For additional commands, e-mail: 




performance over iterate

2002-02-10 Thread Alberto Bolchini

hi all.
 
I'm using a nightly build with the nested extension tags.
 
I expose to the View (jsp) a Component bean (GoF Composite pattern) and
I need to have a 4 level iteration over the Component's children. These
can be Composite (and thus _have_ children) or Leaf (and thus have no
children).
 
I have used the nested extension to iterate over the collections with
something that looks like the following:


 


















   

 
Well. Those four iterations, take a very long time to perform. 
 
Is there a better way to perform the task?
 
Thanx.
alberto.



Handling FormActions correctly

2002-01-20 Thread Alberto Bolchini

Hi all, I'm a struts newbie.
 
I'm tryingto implement a database backed app using postgresql.
 
I'm experiencing a problem over the process of editing/inserting records
with ActionForms.
Following Craig's struts-example and Ted's scaffolding app, to edit a
record, I have an Action to do the fetching from the db, store it in a
bean, copying the bean properties to the perform()'s ActionForm form and
forwarding to the form.jsp.
 
Everything seems to work fine, and before forwarding, form has all the
correct properties (checking with servlet.log()). 

Once I forward to the jsp, the  tags display the data if and
only if I use a 
name="administratorForm" in each tag (being administratorForm the name
of the form-bean of the ActionForm, and the attribute "name" of the
).
 
This seems strange, and moreover, it breaks the validate()-ing process
handled by struts, as I get an exception from the jsp
(javax.servlet.ServletException: No bean found under attribute key
administratorForm) when submitting the Form with not valid values.
 
This is the perform() method:
 
public ActionForward perform(ActionMapping mapping,
 ActionForm form,
 HttpServletRequest request,
 HttpServletResponse response)
 throws IOException, ServletException {
 HttpSession session = request.getSession();
 String action = request.getParameter("action");
 String key = request.getParameter("key");
Integer iKey = null;
if (key != null)
iKey = new Integer(key);
// Identify the relevant administrator
 Bean bean = null;
 if (action.equals("Create")) {
 bean = new Bean();
 } else {
try{
bean = new Bean();
Collection result = Access.select((Object) bean, iKey);
Iterator i = result.iterator();
if (i.hasNext())
bean = (Bean) i.next();
} catch (Exception exc) {
throw new ServletException("EditAction: unable to
retrieve administrator for key " + 
key);
}
 }
 if (bean == null) {
 if (servlet.getDebug() >= 1)
  servlet.log(" No administrator for key " + key);
 return (mapping.findForward("failure"));
 }
bean.setAction(action);

 // Populate the administrator form
 if (form == null) {
if (servlet.getDebug() >= 1)
servlet.log(" Creating new AdministratorForm bean under
key "
+ mapping.getAttribute());
 form = new Form();
if ("request".equals(mapping.getScope()))
request.setAttribute(mapping.getAttribute(), form);
else
session.setAttribute(mapping.getAttribute(), form);
 }
Form subform = (Form) form;
if (servlet.getDebug() >= 1)
servlet.log(" Populating form from " + bean);
try {
PropertyUtils.copyProperties(subform, bean);
} catch (InvocationTargetException e) {
Throwable t = e.getTargetException();
if (t == null)
t = e;
servlet.log("AdministratorForm.populate", t);
throw new ServletException("AdministratorForm.populate", t);
} catch (Throwable t) {
servlet.log("AdministratorForm.populate", t);
throw new ServletException("AdministratorForm.populate", t);
}
if (servlet.getDebug() >= 1)
servlet.log("form.getId()="+((Form) form).getId());
 // Forward control to the edit subscription page
if (servlet.getDebug() >= 1)
servlet.log(" Forwarding to 'success' page");
 return (mapping.findForward("success"));
}
and this is the excerpt from the struts-config.xml:
   
   
   
 
   
   
   
   
   
   
   
   
   
   
   
   
   
   
   
   
   

Thanx for the help.
alberto.