I like this idea :) You could then specify a view to go to based on either ExceptionType, or a return type
There may also be a need to store the result of the POJO method execution
in an action variable
<action name="create" return="transaction">
<param name="method">transferAccount</param>
<param name="param1">acct1</param>
<param name="param2">acct2</param>
<interceptor-ref name="pojo"/>
...
<view exception="PermissionException">Login.action</view>
<view return-value="transaction.approved">AccountSummary.action</view>
<view return-value="transaction.failed">Retry.vm</view>
</action>
Therefore running the action will do this
Try
{
valueStack.push("transaction",
transferAccount(params.get("acct1"), params.get("acct2")))
}
Catch (PermissionException pe)
{
// goto a chained action Login.action
}
If (valueStack.get("transaction.approved"))
{
// goto a chained action AccountSummary.action
}
Else If (valueStack.get("transaction.approved"))
{
// goto view Retry.vm
}
...
-----Original Message-----
From: [EMAIL PROTECTED]
[mailto:[EMAIL PROTECTED]] On Behalf Of
Matt Ho
Sent: Thursday, 20 February 2003 12:37 AM
To: [EMAIL PROTECTED]
Subject: RE: RE: [OS-webwork] re: some suggestion about ww2.0
I think this would be a good thing to put in an interceptor and not in the
core XWork framework. However, putting a param tag inside an action might
not be a bad idea.
<action name="create">
<param name="method">transferAccount</param>
<param name="param1">acct1</param>
<param name="param2">acct2</param>
<interceptor-ref name="pojo"/>
...
</action>
--
Matt Ho
Principal
Indigo Egg, Inc.
http://www.indigoegg.com/
> -----Original Message-----
> From: [EMAIL PROTECTED]
> [mailto:[EMAIL PROTECTED]] On Behalf Of
> Jason Carreira
> Sent: Wednesday, February 19, 2003 5:25 AM
> To: [EMAIL PROTECTED]
> Subject: FW: RE: [OS-webwork] re: some suggestion about ww2.0
>
> Hmmm... This has me thinking. Maybe we could allow command driven
actions
> to specify the method to call (defaulting to doCommandName) to execute
the
> action for that command?
>
> What do we do if the method doesn't return String? Should we try to
catch
> exceptions, then return ERROR if we catch one, or return SUCCESS if
not?
>
> Do we need the Action interface in this case?
>
> Jason
>
> -----Original Message-----
> From: ������ [mailto:[EMAIL PROTECTED]]
> Sent: Wednesday, February 19, 2003 12:25 AM
> To: Jason Carreira
> Subject: RE: RE: [OS-webwork] re: some suggestion about ww2.0
>
>
>
>
> Why could we call common methods of a POJO javabean from some new
tags?
>
>
>
> My problem comes from below situation:
>
>
>
> My system is a 3-tier system, web tier - middle tier - database.
>
> In the middle tier, system is composed of entities and business logic.
>
>
>
> An example of a business logic like this:
>
>
>
> public class AccountManager
>
> {
>
> //create account
>
> public void createAccount(Account account)
>
> {
>
> ...
>
> }
>
>
>
> //transfer amount between accounts
>
> public void transferAccount(String acct1,String
acct2,
> long amount)
>
> {
>
> ...
>
> }
>
>
>
> //get account balance
>
> public balance getAccountBalance(String acct1)
>
> {
>
> ...
>
> }
>
>
>
> ...
>
> }
>
>
>
> In ww1.x, AccountManager cant be directly used as "Control" for
webwork
>
> view technologies. I must translate AccountManager to many "Action"s.
Each
>
> action spreads method params and result to action fields, like this:
>
>
>
> public class CreateAccountAction extends ActionSupport {
>
>
>
> Account account;
>
> public Account getAccount(){};
>
> public void setAccount(Account account){};
>
>
>
> public void execute()
>
> {
>
> //call middle tier logic
>
>
getAccountManger().createAccount(account);
>
> }
>
>
>
> }
>
>
>
> I know the tedious translation work could be automatically by xdoclet.
>
> But if ww2.0 view technologies could support POJO such as
AccountManager
>
> as "Logic" layer, it'll be preferred for programmers like me.
>
> ----- Original Message -----
>
> From:"Jason Carreira" <[EMAIL PROTECTED]>
>
> To:<[EMAIL PROTECTED]>
>
> Subject:RE: [OS-webwork] re: some suggestion about ww2.0
>
> Date:Wed, 19 Feb 2003 12:33:27 +0800
>
> >>
>
> >>
>
> >>
>
> >> Maybe I asked a foolish question or my english is poor
>
> >> ( I am not a native English Speaker). But please correct
>
> >> me if I am wrong.
>
> >>
>
> >> My main suggestion is remove the restriction of Action layer.
>
> >> Could we just use POJO as "Action"? If it's possible, we
>
> >> could say proundly, " No formbeans, No actions " :)
>
> >>
>
> >> Gu Tianyang
>
> >> [EMAIL PROTECTED]
>
> >
>
> >The problem here is that you'll want your web app to DO something.
>
> >Without an Action, how will it be triggered to do something? Is
>
> >populating a javabean the only thing you're looking to do?
>
> >
>
> >Jason
>
> >
>
> >
>
> >-------------------------------------------------------
>
> >This SF.net email is sponsored by: SlickEdit Inc. Develop an edge.
>
> >The most comprehensive and flexible code editor you can use.
>
> >Code faster. C/C++, C#, Java, HTML, XML, many more. FREE 30-Day
Trial.
>
> >www.slickedit.com/sourceforge
>
> >_______________________________________________
>
> >Opensymphony-webwork mailing list
>
> >[EMAIL PROTECTED]
>
> >https://lists.sourceforge.net/lists/listinfo/opensymphony-webwork
>
> >
>
> >
>
>
> ______________________________________
>
>
> ===================================================================
> �ֻ�����������ڳ�;5����/1Ԫ��˧����Ů���վ��ڰ�����
> (http://love.sina.com.cn)
> �ֻ����ŷ���m��888810����ѻ������15M���������䣡
> (http://vip.sina.com/love_send/lover.html)
> �ͷ����ؾ��ֲ� ÿ��5ԪͼƬ�������Ļ�
> (http://sms.sina.com.cn/act/member.html)
>
>
> -------------------------------------------------------
> This SF.net email is sponsored by: SlickEdit Inc. Develop an edge. The
> most comprehensive and flexible code editor you can use. Code faster.
> C/C++, C#, Java, HTML, XML, many more. FREE 30-Day Trial.
> www.slickedit.com/sourceforge
> _______________________________________________
> Opensymphony-webwork mailing list
> [EMAIL PROTECTED]
> https://lists.sourceforge.net/lists/listinfo/opensymphony-webwork
-------------------------------------------------------
This SF.net email is sponsored by: SlickEdit Inc. Develop an edge. The
most comprehensive and flexible code editor you can use. Code faster.
C/C++, C#, Java, HTML, XML, many more. FREE 30-Day Trial.
www.slickedit.com/sourceforge
_______________________________________________
Opensymphony-webwork mailing list
[EMAIL PROTECTED]
https://lists.sourceforge.net/lists/listinfo/opensymphony-webwork
smime.p7s
Description: application/pkcs7-signature
