if the default Action name assignments arent working because of
misconfiguration then assign the specific url
Action annotation
The Convention plugin allows action classes to change the URL that they are
mapped to using the Action annotation. This annotation can also be used inside
the Actions annotation to allow multiple URLs to map to a single action class.
This annotation must be defined on action methods like this:
com.example.actions.HelloWorld
package com.example.actions;
import com.opensymphony.xwork2.ActionSupport;
import org.apache.struts2.convention.annotation.Action;
public class HelloWorld extends ActionSupport {
@Action("/different/url")
public String execute() {
return SUCCESS;
}
public class UndisclosedAndUndocumentedAction extends ActionSupport {
@Action("/myapp")
keep in mind
If no @Result is specified, then the
namespace of the action will be used as the path to the result, on our
last example it would be "/WEB-INF/content/myapp/Result.jsp".
Martin Gainty
______________________________________________
Verzicht und Vertraulichkeitanmerkung/Note de déni et de confidentialité
Diese Nachricht ist vertraulich. Sollten Sie nicht der vorgesehene Empfaenger
sein, so bitten wir hoeflich um eine Mitteilung. Jede unbefugte Weiterleitung
oder Fertigung einer Kopie ist unzulaessig. Diese Nachricht dient lediglich dem
Austausch von Informationen und entfaltet keine rechtliche Bindungswirkung.
Aufgrund der leichten Manipulierbarkeit von E-Mails koennen wir keine Haftung
fuer den Inhalt uebernehmen.
Ce message est confidentiel et peut être privilégié. Si vous n'êtes pas le
destinataire prévu, nous te demandons avec bonté que pour satisfaire informez
l'expéditeur. N'importe quelle diffusion non autorisée ou la copie de ceci est
interdite. Ce message sert à l'information seulement et n'aura pas n'importe
quel effet légalement obligatoire. Étant donné que les email peuvent facilement
être sujets à la manipulation, nous ne pouvons accepter aucune responsabilité
pour le contenu fourni.
> Date: Mon, 1 Jun 2009 06:11:22 -0700
> From: [email protected]
> To: [email protected]
> Subject: RE: 2.1.6 convention plugin problem
>
>
> just to clarify
>
> this works
> http://myserver/myapp/whatever.action
> and to maps to
> WhateverAction.java and whatever.ftl
>
> so application is basically working
>
> but
> http://myserver/myapp/
> does not work
> gives 404 with
> There is no Action mapped for namespace / and action name .
>
> the action name being empty string
>
> usually, including in all the struts2 examples, you want this to go to
> index.jsp or equivalent and do a redirect from there
>
>
> --
> View this message in context:
> http://www.nabble.com/2.1.6-convention-plugin-problem-tp23813162p23814732.html
> Sent from the Struts - User mailing list archive at Nabble.com.
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: [email protected]
> For additional commands, e-mail: [email protected]
>
_________________________________________________________________
Hotmail® has ever-growing storage! Don’t worry about storage limits.
http://windowslive.com/Tutorial/Hotmail/Storage?ocid=TXT_TAGLM_WL_HM_Tutorial_Storage1_052009