Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

WW-4835: Configurable handlers #158

Merged
merged 4 commits into from
Aug 3, 2017
Merged

WW-4835: Configurable handlers #158

merged 4 commits into from
Aug 3, 2017

Conversation

lukaszlenart
Copy link
Member

This PR changes API a bit to allow pass current ActionInvocation to the REST content type handlers to allow implement different behaviour based on a current action.

WW-4835

@asfbot
Copy link

asfbot commented Aug 2, 2017

Lukasz Lenart on dev@struts.apache.org replies:
Hi,

Can you take a look on this?

Thanks in advance
--=20
=C5=81ukasz

2017-08-02 15:02 GMT+02:00 lukaszlenart git@git.apache.org:
the REST content type handlers to allow implement different behaviour base=
d on a current action.
rs
ur
e
se

@cnenning
Copy link
Member

cnenning commented Aug 3, 2017

Using AbstractContentTypeHandler to implement deprecated methods to log on WARN seems like a good idea.

I don't see where new parameter ActionInvocation is actually used. Is that yet to come?

@lukaszlenart
Copy link
Member Author

I don't see where new parameter ActionInvocation is actually used. Is that yet to come?

Not yet :)

@cnenning
Copy link
Member

cnenning commented Aug 3, 2017

Do you want to further develop this PR or merge it first?

@lukaszlenart
Copy link
Member Author

Merge it first as I think those changes are less intrusive as the whole idea in my head ;-)

@cnenning
Copy link
Member

cnenning commented Aug 3, 2017

and what is your idea?

@lukaszlenart
Copy link
Member Author

With the ActionInvocation in place I can access an action which means the action can provide additional informations how to serialise/deserialize object/string via dedicated interfaces, e.g.

public interface DateFormatHandler {
  Date toDate(String dateStr);
  String fromDate(Date date);
}

and when action will implement such interface, a handler can pass formatting a date to the action instead of doing this by itself. And many more :)

@cnenning
Copy link
Member

cnenning commented Aug 3, 2017

sounds great 👍

@asfgit asfgit merged commit ee5575d into apache:master Aug 3, 2017
@lukaszlenart lukaszlenart deleted the configurable-handlers branch August 3, 2017 14:05
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants