You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@struts.apache.org by venkatt <ve...@gmail.com> on 2010/09/14 15:28:17 UTC

Re: parameters in url

Hi..
any sample code how to use 

i tried with the following code ....not successful ...

struts.xml

  	

 	
 	 
 	
	
	  


		
		     {1}
		     {0}
		
	

in action 
public class ContactController extends ActionSupport implements ModelDriven
{
@Action(("/{param1}/Contact/{param2}"))
    public HttpHeaders index() {
   ........
}


please help me what i am doing wrong.....


venkatt 

Musachy Barroso wrote:
> 
> I find that using parameters in urls is confusing in struts, and there
> are just too many (and not compatible) ways of doing it, for example,
> if you want to have parameters in front of the action name, like
> 
> /something/param1/param2/ActionName
> 
> you would have to use the "namedVariable" action mapper, but then, you
> cannot have parameters after the action name ("ActionName"). If you
> want to have parameters after the action name, then you can use
> wildcards, and do something like:
> 
> 
>     
>         {1}
>         /mainMenu.jsp
>     
> 
> 
> And maybe, you can mix them, but I haven't tried that. I find all this
> very confusing and hard to understand. I would like to do this:
> 
> class MyAction {
>   String param1, param2, param3;
> 
>   @Action("/{param1}/{param2}/MyAction/{param3}")
>   public void execute() {....}
> }
> 
> and the framework should figure out the rest for me. I don't think
> this would be that hard to implement and should provide an unified way
> of handling these type of urls. Thoughts?
> 
> musachy
> -- 
> "Hey you! Would you help me to carry the stone?" Pink Floyd
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: dev-unsubscribe@struts.apache.org
> For additional commands, e-mail: dev-help@struts.apache.org
> 
> 
> 

-- 
View this message in context: http://old.nabble.com/parameters-in-url-tp25602877p29708616.html
Sent from the Struts - Dev mailing list archive at Nabble.com.