Re: 2.1.6 convention plugin problem
I agree with that, can you open a jira ticket with the details? regards musachy On Tue, Jun 2, 2009 at 12:51 AM, Ron Chan wrote: > > is this a misconfig or a workaround? > > in 2.0.x the default behaviour for "/" is to go to the welcome file list > > there is no mention of a change in behaviour in any of these > http://struts.apache.org/2.1.6/docs/version-notes-216.html > http://struts.apache.org/2.1.6/docs/action-configuration.html > http://struts.apache.org/2.1.6/docs/convention-plugin.html > > the action-default is a good way of sending user to a "page not found", by > using it to send user to a "home" page means this functionality is now lost > > further more, I now have config in my struts.xml and annotation in my action > just to do this workaround > > I believe there should be a setting that will allow "/" return null mapping > so that request is passed through to the static resource method, at least > then we have a choice > > Ron > > -- > View this message in context: > http://www.nabble.com/2.1.6-convention-plugin-problem-tp23813162p23827727.html > Sent from the Struts - User mailing list archive at Nabble.com. > > > - > To unsubscribe, e-mail: user-unsubscr...@struts.apache.org > For additional commands, e-mail: user-h...@struts.apache.org > > -- "Hey you! Would you help me to carry the stone?" Pink Floyd - To unsubscribe, e-mail: user-unsubscr...@struts.apache.org For additional commands, e-mail: user-h...@struts.apache.org
RE: 2.1.6 convention plugin problem
is this a misconfig or a workaround? in 2.0.x the default behaviour for "/" is to go to the welcome file list there is no mention of a change in behaviour in any of these http://struts.apache.org/2.1.6/docs/version-notes-216.html http://struts.apache.org/2.1.6/docs/action-configuration.html http://struts.apache.org/2.1.6/docs/convention-plugin.html the action-default is a good way of sending user to a "page not found", by using it to send user to a "home" page means this functionality is now lost further more, I now have config in my struts.xml and annotation in my action just to do this workaround I believe there should be a setting that will allow "/" return null mapping so that request is passed through to the static resource method, at least then we have a choice Ron -- View this message in context: http://www.nabble.com/2.1.6-convention-plugin-problem-tp23813162p23827727.html Sent from the Struts - User mailing list archive at Nabble.com. - To unsubscribe, e-mail: user-unsubscr...@struts.apache.org For additional commands, e-mail: user-h...@struts.apache.org
RE: 2.1.6 convention plugin problem
which cleared the misconfig for future reference if a struts<-default>.xml configuration is requested please supply the requested configuration(s) with proprietary values blanked out 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 09:42:06 -0700 > From: rc...@i-tao.com > To: user@struts.apache.org > Subject: Re: 2.1.6 convention plugin problem > > > that kind of worked, I had to make some tweaks > > in struts.xml > > > > > then in my HomeAction.java > @ParentPackage("root") > @Results({ > @Result(name="SUCCESS", location="home.ftl") > }) > > this is even better than an index.jsp that redirects > > Thanks > Ron > > > -- > View this message in context: > http://www.nabble.com/2.1.6-convention-plugin-problem-tp23813162p23818024.html > Sent from the Struts - User mailing list archive at Nabble.com. > > > - > To unsubscribe, e-mail: user-unsubscr...@struts.apache.org > For additional commands, e-mail: user-h...@struts.apache.org > _ 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
Re: 2.1.6 convention plugin problem
that kind of worked, I had to make some tweaks in struts.xml then in my HomeAction.java @ParentPackage("root") @Results({ @Result(name="SUCCESS", location="home.ftl") }) this is even better than an index.jsp that redirects Thanks Ron -- View this message in context: http://www.nabble.com/2.1.6-convention-plugin-problem-tp23813162p23818024.html Sent from the Struts - User mailing list archive at Nabble.com. - To unsubscribe, e-mail: user-unsubscr...@struts.apache.org For additional commands, e-mail: user-h...@struts.apache.org
Re: 2.1.6 convention plugin problem
I usually do something like this: /WEB-INF/content/home.jsp musachy On Mon, Jun 1, 2009 at 6:11 AM, Ron Chan wrote: > > 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: user-unsubscr...@struts.apache.org > For additional commands, e-mail: user-h...@struts.apache.org > > -- "Hey you! Would you help me to carry the stone?" Pink Floyd - To unsubscribe, e-mail: user-unsubscr...@struts.apache.org For additional commands, e-mail: user-h...@struts.apache.org
RE: 2.1.6 convention plugin problem
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: rc...@i-tao.com > To: user@struts.apache.org > 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: user-unsubscr...@struts.apache.org > For additional commands, e-mail: user-h...@struts.apache.org > _ 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
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: user-unsubscr...@struts.apache.org For additional commands, e-mail: user-h...@struts.apache.org
RE: 2.1.6 convention plugin problem
Martin Sorry, I have looked in those docs but can't see anything about this. I have got all the convention stuff up and running, that is not the problem, it is just when you are at the root url where you need it to go to the index.html or index.jsp to do a redirect to your start action is where it is falling over. At the moment I have hacked in a piece of code to the filter to say when the action name is empty string make the mapping null. Thanks Ron -- View this message in context: http://www.nabble.com/2.1.6-convention-plugin-problem-tp23813162p23814119.html Sent from the Struts - User mailing list archive at Nabble.com. - To unsubscribe, e-mail: user-unsubscr...@struts.apache.org For additional commands, e-mail: user-h...@struts.apache.org
RE: 2.1.6 convention plugin problem
http://struts.apache.org/2.1.6/docs/convention-plugin.html Martin __ 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 03:53:11 -0700 > From: rc...@i-tao.com > To: user@struts.apache.org > Subject: 2.1.6 convention plugin problem > > > in StrutsPrepareAndExecuteFilter in 2.1 > > doFilter contains > ActionMapping mapping = prepare.findActionMapping(request, response); > if (mapping == null) { > boolean handled = > execute.executeStaticResourceRequest(request, response); > > however, when using with convention plugin, when accessing the base url > e.g. http://server/myapp/ > > mapping is not null but contains an empty space for the action name > > therefore it errors and never returns index.html or index.jsp or whatever is > in welcome file list > > am I missing a setting somewhere? > > Thanks > Ron > > > -- > View this message in context: > http://www.nabble.com/2.1.6-convention-plugin-problem-tp23813162p23813162.html > Sent from the Struts - User mailing list archive at Nabble.com. > > > - > To unsubscribe, e-mail: user-unsubscr...@struts.apache.org > For additional commands, e-mail: user-h...@struts.apache.org > _ Hotmail® has a new way to see what's up with your friends. http://windowslive.com/Tutorial/Hotmail/WhatsNew?ocid=TXT_TAGLM_WL_HM_Tutorial_WhatsNew1_052009