Re: ProcessAction - Scaffold package

2003-01-28 Thread Ted Husted
It's being caught and wrapped inside of a ResourceAction (which supports 
Exception chaining), as intended.

-Ted.

Senthivel U S wrote:
Greetings,

We are using ProcessAction and Access Layer. Our Access Layer Component
throws SQLException. If exception is thrown , it should be caught by
BaseAction but that is not happening in my case. 

It gives 

java.sql.SQLException: Could not process (--our error message from
stored procedure)
<>

in tomcat log.

Any suggestions is highly appreciated.

I am attaching herewith the tomcat stack trace. 

Regards,
Sen.




org.apache.commons.scaffold.lang.ResourceException: ResourceException: A require
d resource is not available.
at M2AAccessBase.findCollection(M2AAccessBase.java:110)
at BeneficiaryTestBean.execute(BeneficiaryTestBean.java:29)

at M2AProcessBeanBase.execute(M2AProcessBeanBase.java:232)
at M2AProcessBridgeAction.executeLogic(M2AProcessBridgeAc
tion.java:724)
at org.apache.struts.scaffold.BaseHelperAction.executeLogic(Unknown Sour
ce)
at org.apache.struts.scaffold.BaseAction.execute(Unknown Source)
at org.apache.struts.action.RequestProcessor.processActionPerform(Reques
tProcessor.java:446)
at org.apache.struts.action.RequestProcessor.process(RequestProcessor.ja
va:266)
at org.apache.struts.action.ActionServlet.process(ActionServlet.java:129
2)
at org.apache.struts.action.ActionServlet.doPost(ActionServlet.java:510)

at javax.servlet.http.HttpServlet.service(HttpServlet.java:760)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:853)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(Appl
icationFilterChain.java:247)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationF
ilterChain.java:193)
at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperV
alve.java:260)
at org.apache.catalina.core.StandardPipeline$StandardPipelineValveContex
t.invokeNext(StandardPipeline.java:643)
at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.jav
a:480)
at org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:995)

at org.apache.catalina.core.StandardContextValve.invoke(StandardContextV
alve.java:191)
at org.apache.catalina.core.StandardPipeline$StandardPipelineValveContex
t.invokeNext(StandardPipeline.java:643)
at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.jav
a:480)
at org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:995)

at org.apache.catalina.core.StandardContext.invoke(StandardContext.java:
2396)
at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.j
ava:180)
at org.apache.catalina.core.StandardPipeline$StandardPipelineValveContex
t.invokeNext(StandardPipeline.java:643)
at org.apache.catalina.valves.ErrorDispatcherValve.invoke(ErrorDispatche
rValve.java:170)
at org.apache.catalina.core.StandardPipeline$StandardPipelineValveContex
t.invokeNext(StandardPipeline.java:641)
at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.j
ava:172)
at org.apache.catalina.core.StandardPipeline$StandardPipelineValveContex
t.invokeNext(StandardPipeline.java:641)
at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.jav
a:480)
at org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:995)

at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineVal
ve.java:174)
at org.apache.catalina.core.StandardPipeline$StandardPipelineValveContex
t.invokeNext(StandardPipeline.java:643)
at org.apache.catalina.valves.RequestDumperValve.invoke(RequestDumperVal
ve.java:221)
at org.apache.catalina.core.StandardPipeline$StandardPipelineValveContex
t.invokeNext(StandardPipeline.java:641)
at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.jav
a:480)
at org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:995)

at org.apache.coyote.tomcat4.CoyoteAdapter.service(CoyoteAdapter.java:22
3)
at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java
:405)
at org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.proce
ssConnection(Http11Protocol.java:380)
at org.apache.tomcat.util.net.TcpWorkerThread.runIt(PoolTcpEndpoint.java
:508)
at org.apache.tomcat.util.threads.ThreadPool$ControlRunnable.run(ThreadP
ool.java:533)
at java.lang.Thread.run(Thread.java:484)
Caused by:
java.sql.SQLException: Could not process
<>


--
Ted Husted,
Struts in Action 


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




ProcessAction - scaffold package

2003-01-28 Thread Senthivel U S

Greetings,

Actually in the failure of one action mapping , i am forwarding to
another action mapping which is not getting executed. (i.e if any
sqlexception from component, it has to execute another action)

Regards,
Sen

Greetings,

We are using ProcessAction and Access Layer. Our Access Layer Component
throws SQLException. If exception is thrown , it should be caught by
BaseAction but that is not happening in my case. 

It gives 

java.sql.SQLException: Could not process (--our error message from
stored procedure)
<>

in tomcat log.

Any suggestions is highly appreciated.

I am attaching herewith the tomcat stack trace. 

Regards,
Sen.

org.apache.commons.scaffold.lang.ResourceException: ResourceException: A require
d resource is not available.
at M2AAccessBase.findCollection(M2AAccessBase.java:110)
at BeneficiaryTestBean.execute(BeneficiaryTestBean.java:29)

at M2AProcessBeanBase.execute(M2AProcessBeanBase.java:232)
at M2AProcessBridgeAction.executeLogic(M2AProcessBridgeAc
tion.java:724)
at org.apache.struts.scaffold.BaseHelperAction.executeLogic(Unknown Sour
ce)
at org.apache.struts.scaffold.BaseAction.execute(Unknown Source)
at org.apache.struts.action.RequestProcessor.processActionPerform(Reques
tProcessor.java:446)
at org.apache.struts.action.RequestProcessor.process(RequestProcessor.ja
va:266)
at org.apache.struts.action.ActionServlet.process(ActionServlet.java:129
2)
at org.apache.struts.action.ActionServlet.doPost(ActionServlet.java:510)

at javax.servlet.http.HttpServlet.service(HttpServlet.java:760)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:853)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(Appl
icationFilterChain.java:247)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationF
ilterChain.java:193)
at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperV
alve.java:260)
at org.apache.catalina.core.StandardPipeline$StandardPipelineValveContex
t.invokeNext(StandardPipeline.java:643)
at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.jav
a:480)
at org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:995)

at org.apache.catalina.core.StandardContextValve.invoke(StandardContextV
alve.java:191)
at org.apache.catalina.core.StandardPipeline$StandardPipelineValveContex
t.invokeNext(StandardPipeline.java:643)
at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.jav
a:480)
at org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:995)

at org.apache.catalina.core.StandardContext.invoke(StandardContext.java:
2396)
at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.j
ava:180)
at org.apache.catalina.core.StandardPipeline$StandardPipelineValveContex
t.invokeNext(StandardPipeline.java:643)
at org.apache.catalina.valves.ErrorDispatcherValve.invoke(ErrorDispatche
rValve.java:170)
at org.apache.catalina.core.StandardPipeline$StandardPipelineValveContex
t.invokeNext(StandardPipeline.java:641)
at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.j
ava:172)
at org.apache.catalina.core.StandardPipeline$StandardPipelineValveContex
t.invokeNext(StandardPipeline.java:641)
at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.jav
a:480)
at org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:995)

at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineVal
ve.java:174)
at org.apache.catalina.core.StandardPipeline$StandardPipelineValveContex
t.invokeNext(StandardPipeline.java:643)
at org.apache.catalina.valves.RequestDumperValve.invoke(RequestDumperVal
ve.java:221)
at org.apache.catalina.core.StandardPipeline$StandardPipelineValveContex
t.invokeNext(StandardPipeline.java:641)
at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.jav
a:480)
at org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:995)

at org.apache.coyote.tomcat4.CoyoteAdapter.service(CoyoteAdapter.java:22
3)
at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java
:405)
at org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.proce
ssConnection(Http11Protocol.java:380)
at org.apache.tomcat.util.net.TcpWorkerThread.runIt(PoolTcpEndpoint.java
:508)
at org.apache.tomcat.util.threads.ThreadPool$ControlRunnable.run(ThreadP
ool.java:533)
at java.lang.Thread.run(Thread.java:484)
Caused by:
java.sql.SQLException: Could not process
<>

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


ProcessAction - Scaffold package

2003-01-28 Thread Senthivel U S
Greetings,

We are using ProcessAction and Access Layer. Our Access Layer Component
throws SQLException. If exception is thrown , it should be caught by
BaseAction but that is not happening in my case. 

It gives 

java.sql.SQLException: Could not process (--our error message from
stored procedure)
<>

in tomcat log.

Any suggestions is highly appreciated.

I am attaching herewith the tomcat stack trace. 

Regards,
Sen.

org.apache.commons.scaffold.lang.ResourceException: ResourceException: A require
d resource is not available.
at M2AAccessBase.findCollection(M2AAccessBase.java:110)
at BeneficiaryTestBean.execute(BeneficiaryTestBean.java:29)

at M2AProcessBeanBase.execute(M2AProcessBeanBase.java:232)
at M2AProcessBridgeAction.executeLogic(M2AProcessBridgeAc
tion.java:724)
at org.apache.struts.scaffold.BaseHelperAction.executeLogic(Unknown Sour
ce)
at org.apache.struts.scaffold.BaseAction.execute(Unknown Source)
at org.apache.struts.action.RequestProcessor.processActionPerform(Reques
tProcessor.java:446)
at org.apache.struts.action.RequestProcessor.process(RequestProcessor.ja
va:266)
at org.apache.struts.action.ActionServlet.process(ActionServlet.java:129
2)
at org.apache.struts.action.ActionServlet.doPost(ActionServlet.java:510)

at javax.servlet.http.HttpServlet.service(HttpServlet.java:760)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:853)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(Appl
icationFilterChain.java:247)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationF
ilterChain.java:193)
at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperV
alve.java:260)
at org.apache.catalina.core.StandardPipeline$StandardPipelineValveContex
t.invokeNext(StandardPipeline.java:643)
at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.jav
a:480)
at org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:995)

at org.apache.catalina.core.StandardContextValve.invoke(StandardContextV
alve.java:191)
at org.apache.catalina.core.StandardPipeline$StandardPipelineValveContex
t.invokeNext(StandardPipeline.java:643)
at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.jav
a:480)
at org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:995)

at org.apache.catalina.core.StandardContext.invoke(StandardContext.java:
2396)
at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.j
ava:180)
at org.apache.catalina.core.StandardPipeline$StandardPipelineValveContex
t.invokeNext(StandardPipeline.java:643)
at org.apache.catalina.valves.ErrorDispatcherValve.invoke(ErrorDispatche
rValve.java:170)
at org.apache.catalina.core.StandardPipeline$StandardPipelineValveContex
t.invokeNext(StandardPipeline.java:641)
at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.j
ava:172)
at org.apache.catalina.core.StandardPipeline$StandardPipelineValveContex
t.invokeNext(StandardPipeline.java:641)
at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.jav
a:480)
at org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:995)

at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineVal
ve.java:174)
at org.apache.catalina.core.StandardPipeline$StandardPipelineValveContex
t.invokeNext(StandardPipeline.java:643)
at org.apache.catalina.valves.RequestDumperValve.invoke(RequestDumperVal
ve.java:221)
at org.apache.catalina.core.StandardPipeline$StandardPipelineValveContex
t.invokeNext(StandardPipeline.java:641)
at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.jav
a:480)
at org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:995)

at org.apache.coyote.tomcat4.CoyoteAdapter.service(CoyoteAdapter.java:22
3)
at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java
:405)
at org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.proce
ssConnection(Http11Protocol.java:380)
at org.apache.tomcat.util.net.TcpWorkerThread.runIt(PoolTcpEndpoint.java
:508)
at org.apache.tomcat.util.threads.ThreadPool$ControlRunnable.run(ThreadP
ool.java:533)
at java.lang.Thread.run(Thread.java:484)
Caused by:
java.sql.SQLException: Could not process
<>

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


Re: ProcessAction - Scaffold package

2003-01-15 Thread Ted Husted
I just added response to the CheckOutcome signature and its friends, 
including exposeInScope().

Send me the changes that you make to get the cookies up and running and 
we'll get that up too.

Thanks for bringing this up. It should have been there from the 
beginning =:0)

-Ted.

Senthivel U S wrote:
Greetings,



The ProcessAction and ProcessResult were designed to understand the


idea 

of storing something in a "scope". Originally, these set to the 
equivalent of request, session, and application. If you like, we could 
also add a fourth "scope" that would be the equivalent of a "cookie"

(or 

maybe "client") scope.



I could not use exposeInScope() method to set the cookie, since it
doesnot
have response object. I have to add cookie in the response object.

Any suggestions is highly appreciated.

Thanks,

Regards,

Sen







--
Ted Husted,
Struts in Action 


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




ProcessAction - Scaffold package

2003-01-14 Thread Senthivel U S

Greetings,

>The ProcessAction and ProcessResult were designed to understand the
idea 
>of storing something in a "scope". Originally, these set to the 
>equivalent of request, session, and application. If you like, we could 
>also add a fourth "scope" that would be the equivalent of a "cookie"
(or 
>maybe "client") scope.

I could not use exposeInScope() method to set the cookie, since it
doesnot
have response object. I have to add cookie in the response object.

Any suggestions is highly appreciated.

Thanks,

Regards,

Sen




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




Re: ProcessAction - Scaffold package

2003-01-13 Thread Ted Husted
The ProcessAction and ProcessResult were designed to understand the idea 
 of storing something in a "scope". Originally, these set to the 
equivalent of request, session, and application. If you like, we could 
also add a fourth "scope" that would be the equivalent of a "cookie" (or 
maybe "client") scope.

So, the ProcessBean would return a ProcessResult with its data object 
set to whatever you wanted the cookie to store, its scope set to 
"client", and its "name" set to the prospective cookie's name. The 
ProcessAction.exposeInScope could handle the rest.

Of course, since ProcessResult can be an aggregate, you can return this 
along with whatever might need to be returned.

To get started, you could subclass ProcessAction and override 
exposeInScope so that it also looks for a "client" scope and then saves 
the data as a cookie under the given name.

To make the property accessible to future requests, I would put the 
cookie's property on the ActionForm and use reset() to check the request 
for the cookie. If the cookie exists, populate the ActionForm property.

If you have a corresponding property on the ProcessBean, it would be 
transferred automatically, so the domain logic would only need to check 
whether the corresonding property was null.

Meanwhile, I'm starting work today on a similar enterprise framework 
that uses the patterns nomenclature from Martin's Fowler's recent 
"Enterprise Architechtures" book. It will crib alot of the code I'm 
using now but use a vocabulary that's certain to become common before 
long. =:0) I'd also like to move my SQL stuff into the Commons SQL 
package and add support for DynaBeans.

Like the other Scaffold stuff, it will be designed to use Struts as a 
PlugIn for the web tier portion of a multi-tier application. The 
ProcessAction would be virtually the same. The two big changes are that

* I'd like to try adding properties through Composition rather than 
inheritence, and

* I would also like to try using the ActionForm validate to instantiate 
and populate the properties bean for the domain.

The ProcessAction can then just pass a populated, validated domain bean 
up to a gateway object that invokes the domain logic.

-T.

Senthivel U S wrote:
Greetings,

We are planning to use Scaffold package (ProcessAction and AccessLayer).
In the ProcessAction, sometimes we want to get some user data from
database and set it in cookie.  For another request we want to read it
from cookie and merge it with the form bean and send the bean for
process.  As per the Scaffold package document, we can set user data in
cookie using getUserProfile() of ProcessAction.  But the data need to be
retrieved from database for cookie.  For retrieval, i have to call
cookiebean.execute() method. Then I have to process with Collection to
get data. (Since Access layer will always give me
Collection/ProcessResult). Moreover I have to change the executelogic()
method of ProcessAction since all my form beans can not be of type
BaseForm. 

The next approach I planned to use to sort out this issue is as follows.
Configure two beans for one Action. i.e. one bean for actual processing
and other to get the cookie value from database. Here I can not use
getUserProfile() method to set cookie value. I have to use
checkOutCome().
In that also, I have to take some straight approach (outside framework)
to find out from which Collection, I should read the cookie data and set
it
In cookie.

Any suggestions is highly appreciated.

Note: I don't want to make much change in executelogic() of
ProcessAction then it will lead me to deviate from the Framework.

Thanks

Regards,
Sen.






--
Ted Husted,
Struts in Action 


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




ProcessAction - Scaffold package

2003-01-13 Thread Senthivel U S

Greetings,

We are planning to use Scaffold package (ProcessAction and AccessLayer).
In the ProcessAction, sometimes we want to get some user data from
database and set it in cookie.  For another request we want to read it
from cookie and merge it with the form bean and send the bean for
process.  As per the Scaffold package document, we can set user data in
cookie using getUserProfile() of ProcessAction.  But the data need to be
retrieved from database for cookie.  For retrieval, i have to call
cookiebean.execute() method. Then I have to process with Collection to
get data. (Since Access layer will always give me
Collection/ProcessResult). Moreover I have to change the executelogic()
method of ProcessAction since all my form beans can not be of type
BaseForm. 

The next approach I planned to use to sort out this issue is as follows.
Configure two beans for one Action. i.e. one bean for actual processing
and other to get the cookie value from database. Here I can not use
getUserProfile() method to set cookie value. I have to use
checkOutCome().
In that also, I have to take some straight approach (outside framework)
to find out from which Collection, I should read the cookie data and set
it
In cookie.

Any suggestions is highly appreciated.

Note: I don't want to make much change in executelogic() of
ProcessAction then it will lead me to deviate from the Framework.

Thanks

Regards,
Sen.




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