1. So, RESTful plug-in is just for implementing web services in Struts2, isn't it?

2. IMHO, a more detailed documentation would help newbies understand how-to use REST plugin. Specially, explain the use of HTTPHeader instances. From a newbie perspective it is difficult to understand, because we have learned that actions return string results. I believe it worths a post in JIRA, what do you think?

7. Yes, mvn jetty:run works, but pllug-in documentation states to move the war file to the servlet container. That's what I did (St2 2.3.16.1, Tomcat 8.0.3) and it results in HTTP 404. Anyone to double check Tomcat8? I't's a war file, supposed to work in any servlet container.

8. I would recommend to offer wiki links in Documentation section of main site http://struts.apache.org/release/2.3.x/index.html.

Thank you very much.

El 25/04/14 07:13, Lukasz Lenart escribió:
2014-04-24 20:16 GMT+02:00 Antonio Sánchez <ads...@gmail.com>:
Hello.

1. Nowadays: Is RESTful the most recommended approach for implementing CRUD
applications with Struts2? Or is it equivalent to old CRUD style? What are
you doing in your new projects?
No, if your application is a simple CRUD I'd recommend to do it in
classic way, with REST you're building more an API than CRUD - and
designing API is hard :-)

2. Where can I find detailed documentation about RESTful with Struts2? IMHO,
current REST plugin documentation (1) lacks some deepness for newbies like
me.
That's all, maybe some book but I cannot recall which one. Can you
address what are you missing in REST plugin documentation

3. I don't understand the mechanism of returning HttpHeader instances in
action (controller) methods. How does it work?
With REST you must return a bit more than just a result name to use -
ie. status code, cache, etc, that's why HttpHeader is used instead -
just to be clear, even from ordinary Struts action you can return
result directly, eg. instead return "success" do return new
ServletRedirect(...)

4. Should actions always implement ModelDriven?
Nop, as far I remember no

5. Why not extending ActionSupport? Do I still have the full stack of
services ActoinSuport provides: validation, text access... ?
Yes you can, but as REST is just limited to returning simple data
(JSON) all the boilerplate of ActionSupport isn't needed. It's also
recommended way, to implement your own version (or even few) of
ActionSupport - basically it's just a set of simple interfaces, check
implementation.

6. Is convention plugin required? How to do REST without it?
No, but it's quite simpler.

7. Example application 'struts2-rest-showcase' is not working: 'HTTP 404 -
There is no Action mapped for namespace / and action name orders.'
cd apps/rest-showcase
mvn jetty:run
open http://localhost:8080

works!

8. Plug-in documentation error above mapping table: 'Error formatting macro:
snippet: java.lang.IllegalArgumentException: Invalid url: must begin with a
configured prefix.'

RESTful way looks to me as breaking the usual Struts2 style, that's why I
miss more explanatory documentation, specially if your say that indeed
RESTful is the good way of doing CRUD today.
I will try to fix that, anyway we are in process of moving all the
examples from Java source codes to Wiki (to solve problems like that)


Regards


---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscr...@struts.apache.org
For additional commands, e-mail: user-h...@struts.apache.org

Reply via email to