You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@struts.apache.org by Ron Chan <rc...@i-tao.com> on 2009/06/01 12:53:11 UTC

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-unsubscribe@struts.apache.org
For additional commands, e-mail: user-help@struts.apache.org


RE: 2.1.6 convention plugin problem

Posted by Martin Gainty <mg...@hotmail.com>.
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: rchan@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-unsubscribe@struts.apache.org
> For additional commands, e-mail: user-help@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

Posted by Musachy Barroso <mu...@gmail.com>.
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 <rc...@i-tao.com> 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-unsubscribe@struts.apache.org
> For additional commands, e-mail: user-help@struts.apache.org
>
>



-- 
"Hey you! Would you help me to carry the stone?" Pink Floyd

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


RE: 2.1.6 convention plugin problem

Posted by Ron Chan <rc...@i-tao.com>.
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-unsubscribe@struts.apache.org
For additional commands, e-mail: user-help@struts.apache.org


RE: 2.1.6 convention plugin problem

Posted by Martin Gainty <mg...@hotmail.com>.
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 XXXX 

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: rchan@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
> <package name="root" namespace="/" extends="convention-default">
>   <default-action-ref name="home"/>
> </package>
> 
> 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-unsubscribe@struts.apache.org
> For additional commands, e-mail: user-help@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: WAS 6.1: There is no Action mapped for namespace / and action name j_security_check

Posted by Dave Newton <ne...@yahoo.com>.
Have you tried a 2.1.7 build?

Mitchell, Steven wrote:
> I will look at that.  Meanwhile, I found that WAS logged an error (this
> was after the WAS admin tried changing the filter from /* to /[my
> context]/*
> 
> ------Start of DE processing------ = [5/29/09 13:50:09:369 CDT] , key =
> javax.servlet.ServletException
> com.ibm.ws.webcontainer.servlet.ServletWrapper.handleRequest() 309
> Exception = javax.servlet.ServletException
> Source = com.ibm.ws.webcontainer.servlet.ServletWrapper.handleRequest()
> probeid = 309
> Stack Dump = javax.servlet.ServletException: Filter [struts2]: could not
> be initialized
> 	at
> com.ibm.ws.webcontainer.filter.FilterInstanceWrapper.init(FilterInstance
> Wrapper.java:156)
> 	at
> com.ibm.ws.webcontainer.filter.WebAppFilterManager._loadFilter(WebAppFil
> terManager.java:471)
> 	at
> com.ibm.ws.webcontainer.filter.WebAppFilterManager.loadFilter(WebAppFilt
> erManager.java:385)
> 	at
> com.ibm.ws.webcontainer.filter.WebAppFilterManager.getFilterInstanceWrap
> per(WebAppFilterManager.java:244)
> 	at
> com.ibm.ws.webcontainer.filter.WebAppFilterManager.getFilterChain(WebApp
> FilterManager.java:302)
> 	at
> com.ibm.ws.webcontainer.filter.WebAppFilterManager.doFilter(WebAppFilter
> Manager.java:792)
> 	at
> com.ibm.ws.webcontainer.filter.WebAppFilterManager.doFilter(WebAppFilter
> Manager.java:679)
> 	at
> com.ibm.ws.webcontainer.servlet.FileServletWrapper.handleRequest(FileSer
> vletWrapper.java:416)
> 	at
> com.ibm.ws.wswebcontainer.servlet.StaticFileServletWrapper.handleRequest
> (StaticFileServletWrapper.java:93)
> 	at
> com.ibm.ws.webcontainer.extension.DefaultExtensionProcessor.handleReques
> t(DefaultExtensionProcessor.java:714)
> 	at
> com.ibm.ws.wswebcontainer.extension.DefaultExtensionProcessor.handleRequ
> est(DefaultExtensionProcessor.java:113)
> 	at
> com.ibm.ws.webcontainer.webapp.WebApp.handleRequest(WebApp.java:3440)
> 	at
> com.ibm.ws.webcontainer.webapp.WebGroup.handleRequest(WebGroup.java:267)
> 	at
> com.ibm.ws.webcontainer.WebContainer.handleRequest(WebContainer.java:815
> )
> 	at
> com.ibm.ws.wswebcontainer.WebContainer.handleRequest(WebContainer.java:1
> 461)
> 	at
> com.ibm.ws.webcontainer.channel.WCChannelLink.ready(WCChannelLink.java:1
> 18)
> 	at
> com.ibm.ws.http.channel.inbound.impl.HttpInboundLink.handleDiscriminatio
> n(HttpInboundLink.java:458)
> 	at
> com.ibm.ws.http.channel.inbound.impl.HttpInboundLink.handleNewInformatio
> n(HttpInboundLink.java:387)
> 	at
> com.ibm.ws.http.channel.inbound.impl.HttpInboundLink.ready(HttpInboundLi
> nk.java:267)
> 	at
> com.ibm.ws.tcp.channel.impl.NewConnectionInitialReadCallback.sendToDiscr
> iminators(NewConnectionInitialReadCallback.java:214)
> 	at
> com.ibm.ws.tcp.channel.impl.NewConnectionInitialReadCallback.complete(Ne
> wConnectionInitialReadCallback.java:113)
> 	at
> com.ibm.ws.tcp.channel.impl.AioReadCompletionListener.futureCompleted(Ai
> oReadCompletionListener.java:165)
> 	at
> com.ibm.io.async.AbstractAsyncFuture.invokeCallback(AbstractAsyncFuture.
> java:217)
> 	at
> com.ibm.io.async.AsyncChannelFuture.fireCompletionActions(AsyncChannelFu
> ture.java:161)
> 	at com.ibm.io.async.AsyncFuture.completed(AsyncFuture.java:136)
> 	at
> com.ibm.io.async.ResultHandler.complete(ResultHandler.java:195)
> 	at
> com.ibm.io.async.ResultHandler.runEventProcessingLoop(ResultHandler.java
> :743)
> 	at com.ibm.io.async.ResultHandler$2.run(ResultHandler.java:873)
> 	at com.ibm.ws.util.ThreadPool$Worker.run(ThreadPool.java:1473)
> 
> Dump of callerThis = 
> null
> 
> Exception = javax.servlet.ServletException
> Source = com.ibm.ws.webcontainer.servlet.ServletWrapper.handleRequest()
> probeid = 309
> Dump of callerThis = 
> null
> 
> -----Original Message-----
> From: Ron Chan [mailto:rchan@i-tao.com] 
> Sent: Tuesday, June 02, 2009 10:26 AM
> To: user@struts.apache.org
> Subject: Re: WAS 6.1: There is no Action mapped for namespace / and
> action name j_security_check
> 
> 
> Steven
> 
> Not familiar with your setup and if it works in tomcat and not WAS, even
> stranger.  But for what it's worth here is my hack, I made a copy of
> StrutsPrepareAndExecuteFilter and in the doFilter where it said
> 
> ActionMapping mapping = prepare.findActionMapping(request, response);
> if (mapping == null) {
> 	boolean handled = execute.executeStaticResourceRequest(request,
> response);
> 
> I added
> ActionMapping mapping = prepare.findActionMapping(request, response);
> if (mapping != null) {
> 	if ("".equals(mapping.getName())) {
> 		mapping = null;
> 	}
> }
> if (mapping == null) {
> 	boolean handled = execute.executeStaticResourceRequest(request,
> response);
> 
> not ideal, but fixed my prob
> 
> HTH
> Ron
> 

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


RE: WAS 6.1: There is no Action mapped for namespace / and action name j_security_check

Posted by "Mitchell, Steven" <St...@umb.com>.
I will look at that.  Meanwhile, I found that WAS logged an error (this
was after the WAS admin tried changing the filter from /* to /[my
context]/*

------Start of DE processing------ = [5/29/09 13:50:09:369 CDT] , key =
javax.servlet.ServletException
com.ibm.ws.webcontainer.servlet.ServletWrapper.handleRequest() 309
Exception = javax.servlet.ServletException
Source = com.ibm.ws.webcontainer.servlet.ServletWrapper.handleRequest()
probeid = 309
Stack Dump = javax.servlet.ServletException: Filter [struts2]: could not
be initialized
	at
com.ibm.ws.webcontainer.filter.FilterInstanceWrapper.init(FilterInstance
Wrapper.java:156)
	at
com.ibm.ws.webcontainer.filter.WebAppFilterManager._loadFilter(WebAppFil
terManager.java:471)
	at
com.ibm.ws.webcontainer.filter.WebAppFilterManager.loadFilter(WebAppFilt
erManager.java:385)
	at
com.ibm.ws.webcontainer.filter.WebAppFilterManager.getFilterInstanceWrap
per(WebAppFilterManager.java:244)
	at
com.ibm.ws.webcontainer.filter.WebAppFilterManager.getFilterChain(WebApp
FilterManager.java:302)
	at
com.ibm.ws.webcontainer.filter.WebAppFilterManager.doFilter(WebAppFilter
Manager.java:792)
	at
com.ibm.ws.webcontainer.filter.WebAppFilterManager.doFilter(WebAppFilter
Manager.java:679)
	at
com.ibm.ws.webcontainer.servlet.FileServletWrapper.handleRequest(FileSer
vletWrapper.java:416)
	at
com.ibm.ws.wswebcontainer.servlet.StaticFileServletWrapper.handleRequest
(StaticFileServletWrapper.java:93)
	at
com.ibm.ws.webcontainer.extension.DefaultExtensionProcessor.handleReques
t(DefaultExtensionProcessor.java:714)
	at
com.ibm.ws.wswebcontainer.extension.DefaultExtensionProcessor.handleRequ
est(DefaultExtensionProcessor.java:113)
	at
com.ibm.ws.webcontainer.webapp.WebApp.handleRequest(WebApp.java:3440)
	at
com.ibm.ws.webcontainer.webapp.WebGroup.handleRequest(WebGroup.java:267)
	at
com.ibm.ws.webcontainer.WebContainer.handleRequest(WebContainer.java:815
)
	at
com.ibm.ws.wswebcontainer.WebContainer.handleRequest(WebContainer.java:1
461)
	at
com.ibm.ws.webcontainer.channel.WCChannelLink.ready(WCChannelLink.java:1
18)
	at
com.ibm.ws.http.channel.inbound.impl.HttpInboundLink.handleDiscriminatio
n(HttpInboundLink.java:458)
	at
com.ibm.ws.http.channel.inbound.impl.HttpInboundLink.handleNewInformatio
n(HttpInboundLink.java:387)
	at
com.ibm.ws.http.channel.inbound.impl.HttpInboundLink.ready(HttpInboundLi
nk.java:267)
	at
com.ibm.ws.tcp.channel.impl.NewConnectionInitialReadCallback.sendToDiscr
iminators(NewConnectionInitialReadCallback.java:214)
	at
com.ibm.ws.tcp.channel.impl.NewConnectionInitialReadCallback.complete(Ne
wConnectionInitialReadCallback.java:113)
	at
com.ibm.ws.tcp.channel.impl.AioReadCompletionListener.futureCompleted(Ai
oReadCompletionListener.java:165)
	at
com.ibm.io.async.AbstractAsyncFuture.invokeCallback(AbstractAsyncFuture.
java:217)
	at
com.ibm.io.async.AsyncChannelFuture.fireCompletionActions(AsyncChannelFu
ture.java:161)
	at com.ibm.io.async.AsyncFuture.completed(AsyncFuture.java:136)
	at
com.ibm.io.async.ResultHandler.complete(ResultHandler.java:195)
	at
com.ibm.io.async.ResultHandler.runEventProcessingLoop(ResultHandler.java
:743)
	at com.ibm.io.async.ResultHandler$2.run(ResultHandler.java:873)
	at com.ibm.ws.util.ThreadPool$Worker.run(ThreadPool.java:1473)

Dump of callerThis = 
null

Exception = javax.servlet.ServletException
Source = com.ibm.ws.webcontainer.servlet.ServletWrapper.handleRequest()
probeid = 309
Dump of callerThis = 
null

-----Original Message-----
From: Ron Chan [mailto:rchan@i-tao.com] 
Sent: Tuesday, June 02, 2009 10:26 AM
To: user@struts.apache.org
Subject: Re: WAS 6.1: There is no Action mapped for namespace / and
action name j_security_check


Steven

Not familiar with your setup and if it works in tomcat and not WAS, even
stranger.  But for what it's worth here is my hack, I made a copy of
StrutsPrepareAndExecuteFilter and in the doFilter where it said

ActionMapping mapping = prepare.findActionMapping(request, response);
if (mapping == null) {
	boolean handled = execute.executeStaticResourceRequest(request,
response);

I added
ActionMapping mapping = prepare.findActionMapping(request, response);
if (mapping != null) {
	if ("".equals(mapping.getName())) {
		mapping = null;
	}
}
if (mapping == null) {
	boolean handled = execute.executeStaticResourceRequest(request,
response);

not ideal, but fixed my prob

HTH
Ron

-- 
View this message in context:
http://www.nabble.com/2.1.6-convention-plugin-problem-tp23813162p2383486
4.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


------------------------------------------------------------------------------
NOTICE:  This electronic mail message and any attached files are confidential.  The information is exclusively for the use of the individual or entity intended as the recipient.  If you are not the intended recipient, any use, copying, printing, reviewing, retention, disclosure, distribution or forwarding of the message or any attached file is not authorized and is strictly prohibited.  If you have received this electronic mail message in error, please advise the sender by reply electronic mail immediately and permanently delete the original transmission, any attachments and any copies of this message from your computer system. Thank you.

==============================================================================


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


Re: WAS 6.1: There is no Action mapped for namespace / and action name j_security_check

Posted by Ron Chan <rc...@i-tao.com>.
Steven

Not familiar with your setup and if it works in tomcat and not WAS, even
stranger.  But for what it's worth here is my hack, I made a copy of
StrutsPrepareAndExecuteFilter and in the doFilter where it said

ActionMapping mapping = prepare.findActionMapping(request, response);
if (mapping == null) {
	boolean handled = execute.executeStaticResourceRequest(request, response);

I added
ActionMapping mapping = prepare.findActionMapping(request, response);
if (mapping != null) {
	if ("".equals(mapping.getName())) {
		mapping = null;
	}
}
if (mapping == null) {
	boolean handled = execute.executeStaticResourceRequest(request, response);

not ideal, but fixed my prob

HTH
Ron

-- 
View this message in context: http://www.nabble.com/2.1.6-convention-plugin-problem-tp23813162p23834864.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


WAS 6.1: There is no Action mapped for namespace / and action name j_security_check

Posted by "Mitchell, Steven" <St...@umb.com>.
I'm still trying to get Struts 2.1.6 deployed on WAS 6.1.  I'm fighting
a couple of related issues.  Index.jsp forwards to
/MyContext/myNamespace/myAction.action, but gets this error:

    There is no Action mapped for namespace / and action name . -
[unknown location]

If I type http://myServer/myContext/myNamespace/myAction.action in the
browser I get to my log-in page decorated by SiteMesh.  If I submit the
login page I get this error:

    There is no Action mapped for namespace / and action name
j_security_check

The site works fine on Tomcat 5.5.

WebSphere 6.1 is fully patched, is using reverse class loading, and we
have set the following property:

    com.ibm.ws.webcontainer.invokeFiltersCompatibility = true

Here are the filters that we are using:

<filter>
    <filter-name>struts2-prepare</filter-name>
    <filter-class>
        org.apache.struts2.dispatcher.ng.filter.StrutsPrepareFilter
    </filter-class>
</filter>
<filter>
    <filter-name>sitemesh</filter-name>
    <filter-class>
        com.opensymphony.module.sitemesh.filter.PageFilter
    </filter-class>
    </filter>
<filter>
    <filter-name>struts2-execute</filter-name>
    <filter-class>
        org.apache.struts2.dispatcher.ng.filter.StrutsExecuteFilter
    </filter-class>
</filter>

The security looks like this:

<security-constraint>
    <web-resource-collection>
        <web-resource-name>My Secure Stuff</web-resource-name>
        <url-pattern>/MyNamespace/*</url-pattern>
    </web-resource-collection>
    <auth-constraint>
        <role-name>MyRole</role-name>
    </auth-constraint>
</security-constraint>
<login-config>
    <auth-method>FORM</auth-method>
    <form-login-config>
        <form-login-page>/security/login.jsp</form-login-page>
        <form-error-page>/security/login_error.jsp</form-error-page>
    </form-login-config>
</login-config>
<security-role>
    <description>My Role</description>
    <role-name>MyRole</role-name>
</security-role>

Thoughts?

Steve Mitchell
http://www.ByteworksInc.com

------------------------------------------------------------------------------
NOTICE:  This electronic mail message and any attached files are confidential.  The information is exclusively for the use of the individual or entity intended as the recipient.  If you are not the intended recipient, any use, copying, printing, reviewing, retention, disclosure, distribution or forwarding of the message or any attached file is not authorized and is strictly prohibited.  If you have received this electronic mail message in error, please advise the sender by reply electronic mail immediately and permanently delete the original transmission, any attachments and any copies of this message from your computer system. Thank you.

==============================================================================


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


Re: 2.1.6 convention plugin problem

Posted by Ron Chan <rc...@i-tao.com>.
that kind of worked, I had to make some tweaks

in struts.xml
<package name="root" namespace="/" extends="convention-default">
  <default-action-ref name="home"/>
</package>

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-unsubscribe@struts.apache.org
For additional commands, e-mail: user-help@struts.apache.org


Re: 2.1.6 convention plugin problem

Posted by Musachy Barroso <mu...@gmail.com>.
I usually do something like this:

    <package name="root" namespace="/" extends="struts-default">
        <default-action-ref name="home"/>
        <action name="home">
            <result>/WEB-INF/content/home.jsp</result>
        </action>
    </package>

    <constant name="struts.convention.redirect.to.slash" value="true"/>

musachy

On Mon, Jun 1, 2009 at 6:11 AM, Ron Chan <rc...@i-tao.com> 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-unsubscribe@struts.apache.org
> For additional commands, e-mail: user-help@struts.apache.org
>
>



-- 
"Hey you! Would you help me to carry the stone?" Pink Floyd

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


RE: 2.1.6 convention plugin problem

Posted by Ron Chan <rc...@i-tao.com>.
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-unsubscribe@struts.apache.org
For additional commands, e-mail: user-help@struts.apache.org


RE: 2.1.6 convention plugin problem

Posted by Ron Chan <rc...@i-tao.com>.
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-unsubscribe@struts.apache.org
For additional commands, e-mail: user-help@struts.apache.org


RE: 2.1.6 convention plugin problem

Posted by Martin Gainty <mg...@hotmail.com>.

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: rchan@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-unsubscribe@struts.apache.org
> For additional commands, e-mail: user-help@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