You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@struts.apache.org by Jonathan <ja...@i-2000.com> on 2001/06/15 00:30:39 UTC

"Beans shouldnt return values" (my collegues argue)

My 2 collegues argue that the ActionForm (or any bean) should not return values.  They argue that if some day they decide they want to insert a service between the Tag and the Bean,  it would complicate things because the inserted service would be forced to return the Beans object to the Tag:

BEFORE
Tag---->Bean

AFTER
Tag---->Service---->Bean

If the new service wanted to return an int it couldnt because the Tag is expecting a bean.

I truthfully dont know the upside or downside to this, and I personally am not opposed to returning an object.  They would like that the bean throw an Exception instead.

Could you all comment on this as I do not see a problem with a Bean returning an object

RE: Interbase/interclient

Posted by Ali Ozoren <oz...@home.com>.
Problem solved. I provided the “password” parameter and apparently it was
all it was looking for. The error message wasn’t all that clear as you can
tell. Documentation may need to be updated as to tell that struts do try to
connect to the defined data sources, even though it wasn’t asked to.

Well, thanks everyone.
--a

-----Original Message-----
From: Ali Ozoren [mailto:ozorena@home.com]
Sent: Wednesday, August 23, 2000 8:58 PM
To: struts-user@jakarta.apache.org
Subject: Interbase/interclient

Hi all- I had this problem with the following sturts data source (as
configured in sturts-config.xml). I was previously using jdbc-odbc, but then
I realized it doesn’t support prepared statements (duh) I’ve decided to
switch to a real db. Interbase was my choice. However if I add the following
declaration in struts-config.xml, I start getting
“javax.servlet.ServletException: Cannot find ActionMappings or
ActionFormBeans collection” for no apparent reason. I tried to change the
direction of slashes but didn’t work. If I take it out, my first fake login
page shows up no problem. Any idea?
Thanks, --a


    <data-source
       key="dbtest"
       autoCommit="false"
       description="Police Datasource"
       driverClass="interbase.interclient.Driver"
       maxCount="4"
       minCount="2"
       url="jdbc:interbase://localhost/c:/data/projects/test/test.gdb"
       user="sysdba"
    />

Interbase/interclient

Posted by Ali Ozoren <oz...@home.com>.
Hi all- I had this problem with the following sturts data source (as
configured in sturts-config.xml). I was previously using jdbc-odbc, but then
I realized it doesn’t support prepared statements (duh) I’ve decided to
switch to a real db. Interbase was my choice. However if I add the following
declaration in struts-config.xml, I start getting
“javax.servlet.ServletException: Cannot find ActionMappings or
ActionFormBeans collection” for no apparent reason. I tried to change the
direction of slashes but didn’t work. If I take it out, my first fake login
page shows up no problem. Any idea?
Thanks, --a


    <data-source
       key="dbtest"
       autoCommit="false"
       description="Police Datasource"
       driverClass="interbase.interclient.Driver"
       maxCount="4"
       minCount="2"
       url="jdbc:interbase://localhost/c:/data/projects/test/test.gdb"
       user="sysdba"
    />

calling form bean method

Posted by Ali Ozoren <oz...@home.com>.
Hi all,

I have a method that returns a String in the form bean. How can I call it
from within the JSP page that uses that bean? Couldn't find a way to refer
to the underlying form bean..
Thanks,
--a