struts-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Johannes Geppert <jo...@web.de>
Subject Re: Struts, Convention plugin and REST plugin
Date Fri, 16 Jul 2010 08:31:30 GMT

did it work when you don't use the action annotations ?
Because with Rest Plugin you have already an action called "posts"

Try it only with the Results annotations.
@Results( {
  @Result(name="newpost", location="newpost"),
  @Result(name="posts", location="posts")
})
public class PostsController implements Preparable,
		ModelDriven<List<PostViewModel>>
{
public String editNew()
{
	return "newpost";
}

public String index()
{
	return "posts";
}

}

Best Regards

Johannes Geppert


Kevin Jones-10 wrote:
> 
> I'm having a problem using Struts/Convention/REST together/
> 
> I have a class that looks like this
> 
> public class PostsController implements Preparable,
> 		ModelDriven<List<PostViewModel>>
> {
> }
> 
> with two 'action' methods
> 
> @Action(results={@Result(name="newpost", location="newpost")})
> public String editNew()
> {
> 	return "newpost";
> }
> 
> @Action(results={@Result(name="posts", location="posts")})
> public String index()
> {
> 	return "posts";
> }
> 
> 
> Originally I only had the index method and it worked fine. After
> adding the editNew method the index method has stopped working (the
> editNew method works fine).
> 
> If I comment out the @Action above the editNew method then the index
> method starts working (and the editNew stops working).
> 
> Depending on the method that's not working the error I get is "No
> result defined for action com.mantiso.jsblog.actions.PostsController
> and result newpost"
> or "No result defined for action
> com.mantiso.jsblog.actions.PostsController and result posts"
> 
> Any help would be gratefully accepted,
> 
> -- 
> Kevin
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
> For additional commands, e-mail: user-help@struts.apache.org
> 
> 
> 


-----
---
web: http://www.jgeppert.com
twitter: http://twitter.com/jogep

-- 
View this message in context: http://old.nabble.com/Struts%2C-Convention-plugin-and-REST-plugin-tp29177483p29181314.html
Sent from the Struts - User mailing list archive at Nabble.com.


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


Mime
View raw message