You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@struts.apache.org by "ronald.a.andersen@gmail.com" <ro...@gmail.com> on 2016/10/30 17:59:24 UTC

convention plugin struts.xml interceptors

My actions are working fine by following the convention rules - no struts.xml required; I need to configure a custom interceptor, so struts.xml is required. As soon as I add the struts.xml, the following exception is returned:

Oct 30, 2016 1:54:22 PM org.apache.struts2.dispatcher.Dispatcher error
SEVERE: Exception occurred during processing request: No result defined for action net.codejava.struts.LoginAction and result success
No result defined for action net.codejava.struts.LoginAction and result success 

How can the struts.xml be configured to ignore the action or how can the convention plugin override the struts.xml? Do not want to add the LoginAction to the struts.xml


Struts2 version->struts2-core-2.3.15.1

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


Re: convention plugin struts.xml interceptors

Posted by "ronald.a.andersen@gmail.com" <ro...@gmail.com>.

On 2016-11-01 12:20 (-0400), Lukasz Lenart <lu...@apache.org> wrote: 
> 2016-11-01 4:00 GMT+01:00 Ronald Andersen <ro...@gmail.com>:
> > Hi Lakasz
> >
> > Below is the struts.xml and LoginAction (for reference). Using default for
> >  package name in struts.xml:
> >
> > <?xml version="1.0" encoding="UTF-8"?>
> >
> > <!DOCTYPE struts PUBLIC
> > "-//Apache Software Foundation//DTD Struts Configuration 2.3//EN"
> > "http://struts.apache.org/dtds/struts-2.3.dtd">
> > <struts>
> > <!-- constant to define result path locations to project root directory -->
> > <constant name="struts.convention.result.path" value="/"></constant>
> > <package name="default" namespace="/" extends="struts-default">
> >         <interceptors>
> >             <interceptor name="myCustomInterceptor"
> > class="net.codejava.struts.MyCustomInterceptor" />
> >             <interceptor-stack name="customStack">
> >                 <interceptor-ref name="myCustomInterceptor"/>
> >             </interceptor-stack>
> >         </interceptors>
> >     </package>
> >
> > </struts>
> 
> Do you have more interceptors in your customStack? Secondly, did you
> define it as a default stack with <default-interceptor-ref/> ?
> 
> I'm using almost the same setup and everything is working perfectly
> fine. Are you sure there is no exception when starting container?
> Here you have almost the same setup
> https://github.com/apache/struts-examples/tree/master/unknown-handler
> 
> 
> Regards
> -- 
> \u0141ukasz
> + 48 606 323 122 http://www.lenart.org.pl/
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
> For additional commands, e-mail: user-help@struts.apache.org
> 
> Hi Lakasz

The constant within struts.xml below was  pointing to the root path
<constant name="struts.convention.result.path" value="/"></constant>

I had two options - remove it or point to the correct path below, which seems to be the default; removed it:
<constant name="struts.convention.result.path" value="/WEB-INF/content"></constant>

Thanks for responding - thread closed!

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


Re: convention plugin struts.xml interceptors

Posted by "ronald.a.andersen@gmail.com" <ro...@gmail.com>.

On 2016-11-01 15:17 (-0400), Ken McWilliams <ke...@gmail.com> wrote: 
> Am I wrong in assuming that this new package is supposed to be the default?
> If so it should extend conventions-default and there is some constant that
> should be set such that conventions uses this package by default.
> 
> Also, perhaps of greater importance: If conventions was working before then
> the results would by default be in /WEB-INF/content/ and does not <constant
> name="struts.convention.result.path" value="/"></constant> now ask struts
> to search at the root? In which case it probably won't find the previously
> established views?
> 
> For reference see: https://struts.apache.org/docs/convention-plugin.html
> Search on that page for:
> struts.convention.result.path and
> struts.convention.default.parent.package
> 
> On Tue, Nov 1, 2016 at 1:05 PM, ronald.a.andersen@gmail.com <
> ronald.a.andersen@gmail.com> wrote:
> 
> >
> >
> > On 2016-11-01 12:20 (-0400), Lukasz Lenart <lu...@apache.org>
> > wrote:
> > > 2016-11-01 4:00 GMT+01:00 Ronald Andersen <ro...@gmail.com>:
> > > > Hi Lakasz
> > > >
> > > > Below is the struts.xml and LoginAction (for reference). Using default
> > for
> > > >  package name in struts.xml:
> > > >
> > > > <?xml version="1.0" encoding="UTF-8"?>
> > > >
> > > > <!DOCTYPE struts PUBLIC
> > > > "-//Apache Software Foundation//DTD Struts Configuration 2.3//EN"
> > > > "http://struts.apache.org/dtds/struts-2.3.dtd">
> > > > <struts>
> > > > <!-- constant to define result path locations to project root
> > directory -->
> > > > <constant name="struts.convention.result.path" value="/"></constant>
> > > > <package name="default" namespace="/" extends="struts-default">
> > > >         <interceptors>
> > > >             <interceptor name="myCustomInterceptor"
> > > > class="net.codejava.struts.MyCustomInterceptor" />
> > > >             <interceptor-stack name="customStack">
> > > >                 <interceptor-ref name="myCustomInterceptor"/>
> > > >             </interceptor-stack>
> > > >         </interceptors>
> > > >     </package>
> > > >
> > > > </struts>
> > >
> > > Do you have more interceptors in your customStack? Secondly, did you
> > > define it as a default stack with <default-interceptor-ref/> ?
> > >
> > > I'm using almost the same setup and everything is working perfectly
> > > fine. Are you sure there is no exception when starting container?
> > > Here you have almost the same setup
> > > https://github.com/apache/struts-examples/tree/master/unknown-handler
> > >
> > >
> > > Regards
> > > --
> > > \u0141ukasz
> > > + 48 606 323 122 http://www.lenart.org.pl/
> > >
> > > ---------------------------------------------------------------------
> > > To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
> > > For additional commands, e-mail: user-help@struts.apache.org
> > >
> > > Hi Lukasz,
> >
> > Reviewing struts-examples/unknown-handler/ and interceptors
> >
> > ---------------------------------------------------------------------
> > To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
> > For additional commands, e-mail: user-help@struts.apache.org
> >
> >
> 
> 
> -- 
> Sent from my C64 using a 300 baud modem
> Hi Ken,

Your correct! 

The constant below was  pointing to the root path
<constant name="struts.convention.result.path" value="/"></constant>

I had two options - remove it or point to the correct path below, which seems to be the default; removed it:
<constant name="struts.convention.result.path" value="/WEB-INF/content"></constant>


Thanks!


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


Re: convention plugin struts.xml interceptors

Posted by "ronald.a.andersen@gmail.com" <ro...@gmail.com>.

On 2016-11-01 15:17 (-0400), Ken McWilliams <ke...@gmail.com> wrote: 
> Am I wrong in assuming that this new package is supposed to be the default?
> If so it should extend conventions-default and there is some constant that
> should be set such that conventions uses this package by default.
> 
> Also, perhaps of greater importance: If conventions was working before then
> the results would by default be in /WEB-INF/content/ and does not <constant
> name="struts.convention.result.path" value="/"></constant> now ask struts
> to search at the root? In which case it probably won't find the previously
> established views?
> 
> For reference see: https://struts.apache.org/docs/convention-plugin.html
> Search on that page for:
> struts.convention.result.path and
> struts.convention.default.parent.package
> 
> On Tue, Nov 1, 2016 at 1:05 PM, ronald.a.andersen@gmail.com <
> ronald.a.andersen@gmail.com> wrote:
> 
> >
> >
> > On 2016-11-01 12:20 (-0400), Lukasz Lenart <lu...@apache.org>
> > wrote:
> > > 2016-11-01 4:00 GMT+01:00 Ronald Andersen <ro...@gmail.com>:
> > > > Hi Lakasz
> > > >
> > > > Below is the struts.xml and LoginAction (for reference). Using default
> > for
> > > >  package name in struts.xml:
> > > >
> > > > <?xml version="1.0" encoding="UTF-8"?>
> > > >
> > > > <!DOCTYPE struts PUBLIC
> > > > "-//Apache Software Foundation//DTD Struts Configuration 2.3//EN"
> > > > "http://struts.apache.org/dtds/struts-2.3.dtd">
> > > > <struts>
> > > > <!-- constant to define result path locations to project root
> > directory -->
> > > > <constant name="struts.convention.result.path" value="/"></constant>
> > > > <package name="default" namespace="/" extends="struts-default">
> > > >         <interceptors>
> > > >             <interceptor name="myCustomInterceptor"
> > > > class="net.codejava.struts.MyCustomInterceptor" />
> > > >             <interceptor-stack name="customStack">
> > > >                 <interceptor-ref name="myCustomInterceptor"/>
> > > >             </interceptor-stack>
> > > >         </interceptors>
> > > >     </package>
> > > >
> > > > </struts>
> > >
> > > Do you have more interceptors in your customStack? Secondly, did you
> > > define it as a default stack with <default-interceptor-ref/> ?
> > >
> > > I'm using almost the same setup and everything is working perfectly
> > > fine. Are you sure there is no exception when starting container?
> > > Here you have almost the same setup
> > > https://github.com/apache/struts-examples/tree/master/unknown-handler
> > >
> > >
> > > Regards
> > > --
> > > \u0141ukasz
> > > + 48 606 323 122 http://www.lenart.org.pl/
> > >
> > > ---------------------------------------------------------------------
> > > To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
> > > For additional commands, e-mail: user-help@struts.apache.org
> > >
> > > Hi Lukasz,
> >
> > Reviewing struts-examples/unknown-handler/ and interceptors
> >
> > ---------------------------------------------------------------------
> > To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
> > For additional commands, e-mail: user-help@struts.apache.org
> >
> >
> 
> 
> -- 
> Sent from my C64 using a 300 baud modem
> Hi Ken,

Reviewing the convention plugin documentation

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


Re: convention plugin struts.xml interceptors

Posted by Ken McWilliams <ke...@gmail.com>.
Am I wrong in assuming that this new package is supposed to be the default?
If so it should extend conventions-default and there is some constant that
should be set such that conventions uses this package by default.

Also, perhaps of greater importance: If conventions was working before then
the results would by default be in /WEB-INF/content/ and does not <constant
name="struts.convention.result.path" value="/"></constant> now ask struts
to search at the root? In which case it probably won't find the previously
established views?

For reference see: https://struts.apache.org/docs/convention-plugin.html
Search on that page for:
struts.convention.result.path and
struts.convention.default.parent.package

On Tue, Nov 1, 2016 at 1:05 PM, ronald.a.andersen@gmail.com <
ronald.a.andersen@gmail.com> wrote:

>
>
> On 2016-11-01 12:20 (-0400), Lukasz Lenart <lu...@apache.org>
> wrote:
> > 2016-11-01 4:00 GMT+01:00 Ronald Andersen <ro...@gmail.com>:
> > > Hi Lakasz
> > >
> > > Below is the struts.xml and LoginAction (for reference). Using default
> for
> > >  package name in struts.xml:
> > >
> > > <?xml version="1.0" encoding="UTF-8"?>
> > >
> > > <!DOCTYPE struts PUBLIC
> > > "-//Apache Software Foundation//DTD Struts Configuration 2.3//EN"
> > > "http://struts.apache.org/dtds/struts-2.3.dtd">
> > > <struts>
> > > <!-- constant to define result path locations to project root
> directory -->
> > > <constant name="struts.convention.result.path" value="/"></constant>
> > > <package name="default" namespace="/" extends="struts-default">
> > >         <interceptors>
> > >             <interceptor name="myCustomInterceptor"
> > > class="net.codejava.struts.MyCustomInterceptor" />
> > >             <interceptor-stack name="customStack">
> > >                 <interceptor-ref name="myCustomInterceptor"/>
> > >             </interceptor-stack>
> > >         </interceptors>
> > >     </package>
> > >
> > > </struts>
> >
> > Do you have more interceptors in your customStack? Secondly, did you
> > define it as a default stack with <default-interceptor-ref/> ?
> >
> > I'm using almost the same setup and everything is working perfectly
> > fine. Are you sure there is no exception when starting container?
> > Here you have almost the same setup
> > https://github.com/apache/struts-examples/tree/master/unknown-handler
> >
> >
> > Regards
> > --
> > Łukasz
> > + 48 606 323 122 http://www.lenart.org.pl/
> >
> > ---------------------------------------------------------------------
> > To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
> > For additional commands, e-mail: user-help@struts.apache.org
> >
> > Hi Lukasz,
>
> Reviewing struts-examples/unknown-handler/ and interceptors
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
> For additional commands, e-mail: user-help@struts.apache.org
>
>


-- 
Sent from my C64 using a 300 baud modem

Re: convention plugin struts.xml interceptors

Posted by "ronald.a.andersen@gmail.com" <ro...@gmail.com>.

On 2016-11-01 12:20 (-0400), Lukasz Lenart <lu...@apache.org> wrote: 
> 2016-11-01 4:00 GMT+01:00 Ronald Andersen <ro...@gmail.com>:
> > Hi Lakasz
> >
> > Below is the struts.xml and LoginAction (for reference). Using default for
> >  package name in struts.xml:
> >
> > <?xml version="1.0" encoding="UTF-8"?>
> >
> > <!DOCTYPE struts PUBLIC
> > "-//Apache Software Foundation//DTD Struts Configuration 2.3//EN"
> > "http://struts.apache.org/dtds/struts-2.3.dtd">
> > <struts>
> > <!-- constant to define result path locations to project root directory -->
> > <constant name="struts.convention.result.path" value="/"></constant>
> > <package name="default" namespace="/" extends="struts-default">
> >         <interceptors>
> >             <interceptor name="myCustomInterceptor"
> > class="net.codejava.struts.MyCustomInterceptor" />
> >             <interceptor-stack name="customStack">
> >                 <interceptor-ref name="myCustomInterceptor"/>
> >             </interceptor-stack>
> >         </interceptors>
> >     </package>
> >
> > </struts>
> 
> Do you have more interceptors in your customStack? Secondly, did you
> define it as a default stack with <default-interceptor-ref/> ?
> 
> I'm using almost the same setup and everything is working perfectly
> fine. Are you sure there is no exception when starting container?
> Here you have almost the same setup
> https://github.com/apache/struts-examples/tree/master/unknown-handler
> 
> 
> Regards
> -- 
> \u0141ukasz
> + 48 606 323 122 http://www.lenart.org.pl/
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
> For additional commands, e-mail: user-help@struts.apache.org
> 
> Hi Lukasz,

Reviewing struts-examples/unknown-handler/ and interceptors

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


Re: convention plugin struts.xml interceptors

Posted by "ronald.a.andersen@gmail.com" <ro...@gmail.com>.

On 2016-11-01 12:20 (-0400), Lukasz Lenart <lu...@apache.org> wrote: 
> 2016-11-01 4:00 GMT+01:00 Ronald Andersen <ro...@gmail.com>:
> > Hi Lakasz
> >
> > Below is the struts.xml and LoginAction (for reference). Using default for
> >  package name in struts.xml:
> >
> > <?xml version="1.0" encoding="UTF-8"?>
> >
> > <!DOCTYPE struts PUBLIC
> > "-//Apache Software Foundation//DTD Struts Configuration 2.3//EN"
> > "http://struts.apache.org/dtds/struts-2.3.dtd">
> > <struts>
> > <!-- constant to define result path locations to project root directory -->
> > <constant name="struts.convention.result.path" value="/"></constant>
> > <package name="default" namespace="/" extends="struts-default">
> >         <interceptors>
> >             <interceptor name="myCustomInterceptor"
> > class="net.codejava.struts.MyCustomInterceptor" />
> >             <interceptor-stack name="customStack">
> >                 <interceptor-ref name="myCustomInterceptor"/>
> >             </interceptor-stack>
> >         </interceptors>
> >     </package>
> >
> > </struts>
> 
> Do you have more interceptors in your customStack? Secondly, did you
> define it as a default stack with <default-interceptor-ref/> ?
> 
> I'm using almost the same setup and everything is working perfectly
> fine. Are you sure there is no exception when starting container?
> Here you have almost the same setup
> https://github.com/apache/struts-examples/tree/master/unknown-handler
> 
> 
> Regards
> -- 
> \u0141ukasz
> + 48 606 323 122 http://www.lenart.org.pl/
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
> For additional commands, e-mail: user-help@struts.apache.org
> 
> The struts.xml from struts-examples/tree/master/unknown-handler worked in my project. Comparing that one and mine.


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


Re: convention plugin struts.xml interceptors

Posted by Lukasz Lenart <lu...@apache.org>.
2016-11-01 4:00 GMT+01:00 Ronald Andersen <ro...@gmail.com>:
> Hi Lakasz
>
> Below is the struts.xml and LoginAction (for reference). Using default for
>  package name in struts.xml:
>
> <?xml version="1.0" encoding="UTF-8"?>
>
> <!DOCTYPE struts PUBLIC
> "-//Apache Software Foundation//DTD Struts Configuration 2.3//EN"
> "http://struts.apache.org/dtds/struts-2.3.dtd">
> <struts>
> <!-- constant to define result path locations to project root directory -->
> <constant name="struts.convention.result.path" value="/"></constant>
> <package name="default" namespace="/" extends="struts-default">
>         <interceptors>
>             <interceptor name="myCustomInterceptor"
> class="net.codejava.struts.MyCustomInterceptor" />
>             <interceptor-stack name="customStack">
>                 <interceptor-ref name="myCustomInterceptor"/>
>             </interceptor-stack>
>         </interceptors>
>     </package>
>
> </struts>

Do you have more interceptors in your customStack? Secondly, did you
define it as a default stack with <default-interceptor-ref/> ?

I'm using almost the same setup and everything is working perfectly
fine. Are you sure there is no exception when starting container?
Here you have almost the same setup
https://github.com/apache/struts-examples/tree/master/unknown-handler


Regards
-- 
Łukasz
+ 48 606 323 122 http://www.lenart.org.pl/

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


Re: convention plugin struts.xml interceptors

Posted by Ronald Andersen <ro...@gmail.com>.
Hi Lakasz

Below is the struts.xml and LoginAction (for reference). Using default for
 package name in struts.xml:

<?xml version="1.0" encoding="UTF-8"?>

<!DOCTYPE struts PUBLIC
"-//Apache Software Foundation//DTD Struts Configuration 2.3//EN"
"http://struts.apache.org/dtds/struts-2.3.dtd">
<struts>
<!-- constant to define result path locations to project root directory -->
<constant name="struts.convention.result.path" value="/"></constant>
<package name="default" namespace="/" extends="struts-default">
        <interceptors>
            <interceptor name="myCustomInterceptor"
class="net.codejava.struts.MyCustomInterceptor" />
            <interceptor-stack name="customStack">
                <interceptor-ref name="myCustomInterceptor"/>
            </interceptor-stack>
        </interceptors>
    </package>

</struts>

package net.codejava.struts;
import com.opensymphony.xwork2.ActionSupport;
import com.opensymphony.xwork2.validator.annotations.EmailValidator;
import
com.opensymphony.xwork2.validator.annotations.RequiredStringValidator;



public class LoginAction extends ActionSupport {
/**
*
*/
private static final long serialVersionUID = -7413249884096556212L;
private String email;
private String password;

public String execute() {
if (email != null && email.equals("admin@codejava.net")) {
return SUCCESS;
} else {
return INPUT;
}
}
@RequiredStringValidator(message = "Please enter your e-mail address.")
@EmailValidator(message = "Please enter a valid e-mail address.")
public void setEmail(String email) {
this.email = email;
}
@RequiredStringValidator(message = "Please enter your password.")
public void setPassword(String password) {
this.password = password;
}
public String getEmail() {
return email;
}
public String getPassword() {
return password;
}
}

On Mon, Oct 31, 2016 at 3:58 PM, Lukasz Lenart <lu...@apache.org>
wrote:

> 2016-10-30 18:59 GMT+01:00 ronald.a.andersen@gmail.com
> <ro...@gmail.com>:
> > My actions are working fine by following the convention rules - no
> struts.xml required; I need to configure a custom interceptor, so
> struts.xml is required. As soon as I add the struts.xml, the following
> exception is returned:
> >
> > Oct 30, 2016 1:54:22 PM org.apache.struts2.dispatcher.Dispatcher error
> > SEVERE: Exception occurred during processing request: No result defined
> for action net.codejava.struts.LoginAction and result success
> > No result defined for action net.codejava.struts.LoginAction and result
> success
> >
> > How can the struts.xml be configured to ignore the action or how can the
> convention plugin override the struts.xml? Do not want to add the
> LoginAction to the struts.xml
>
> Can you post content of your struts.xml? I think you have defined a
> main package and that's why such action isn't available.
>
>
> Regards
> --
> Łukasz
> + 48 606 323 122 http://www.lenart.org.pl/
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
> For additional commands, e-mail: user-help@struts.apache.org
>
>

Re: convention plugin struts.xml interceptors

Posted by "ronald.a.andersen@gmail.com" <ro...@gmail.com>.

On 2016-10-31 15:58 (-0400), Lukasz Lenart <lu...@apache.org> wrote: 
> 2016-10-30 18:59 GMT+01:00 ronald.a.andersen@gmail.com
> <ro...@gmail.com>:
> > My actions are working fine by following the convention rules - no struts.xml required; I need to configure a custom interceptor, so struts.xml is required. As soon as I add the struts.xml, the following exception is returned:
> >
> > Oct 30, 2016 1:54:22 PM org.apache.struts2.dispatcher.Dispatcher error
> > SEVERE: Exception occurred during processing request: No result defined for action net.codejava.struts.LoginAction and result success
> > No result defined for action net.codejava.struts.LoginAction and result success
> >
> > How can the struts.xml be configured to ignore the action or how can the convention plugin override the struts.xml? Do not want to add the LoginAction to the struts.xml
> 
> Can you post content of your struts.xml? I think you have defined a
> main package and that's why such action isn't available.
> 
> 
> Regards
> -- 
> \u0141ukasz
> + 48 606 323 122 http://www.lenart.org.pl/
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
> For additional commands, e-mail: user-help@struts.apache.org
> 
> Hi Lakasz

Below is the struts.xml and LoginAction (for reference). Using default for  package name in struts.xml:
Just want to use the conventional plugin and struts.xml for interceptors but no actions defined in struts.xml via conventional plugin

<?xml version="1.0" encoding="UTF-8"?>

<!DOCTYPE struts PUBLIC
	"-//Apache Software Foundation//DTD Struts Configuration 2.3//EN"
	"http://struts.apache.org/dtds/struts-2.3.dtd">
<struts>
	<!-- constant to define result path locations to project root directory -->
	<constant name="struts.convention.result.path" value="/"></constant>
	
	<package name="default" namespace="/" extends="struts-default">
        <interceptors>   
            <interceptor name="myCustomInterceptor" class="net.codejava.struts.MyCustomInterceptor" />
            <interceptor-stack name="customStack">
                <interceptor-ref name="myCustomInterceptor"/>
            </interceptor-stack>
        </interceptors>      
    </package>

</struts>

package net.codejava.struts;
import com.opensymphony.xwork2.ActionSupport;
import com.opensymphony.xwork2.validator.annotations.EmailValidator;
import com.opensymphony.xwork2.validator.annotations.RequiredStringValidator;



public class LoginAction extends ActionSupport {
	/**
	 * 
	 */
	private static final long serialVersionUID = -7413249884096556212L;
	private String email;
	private String password;

	public String execute() {
		if (email != null && email.equals("admin@codejava.net")) {
			return SUCCESS;			
		} else {
			return INPUT;
		}
	}
	
	@RequiredStringValidator(message = "Please enter your e-mail address.")
	@EmailValidator(message = "Please enter a valid e-mail address.")
	public void setEmail(String email) {
		this.email = email;
	}
	
	@RequiredStringValidator(message = "Please enter your password.")
	public void setPassword(String password) {
		this.password = password;
	}
	
	public String getEmail() {
		return email;
	}
	
	public String getPassword() {
		return password;
	}
}

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


Re: convention plugin struts.xml interceptors

Posted by Lukasz Lenart <lu...@apache.org>.
2016-10-30 18:59 GMT+01:00 ronald.a.andersen@gmail.com
<ro...@gmail.com>:
> My actions are working fine by following the convention rules - no struts.xml required; I need to configure a custom interceptor, so struts.xml is required. As soon as I add the struts.xml, the following exception is returned:
>
> Oct 30, 2016 1:54:22 PM org.apache.struts2.dispatcher.Dispatcher error
> SEVERE: Exception occurred during processing request: No result defined for action net.codejava.struts.LoginAction and result success
> No result defined for action net.codejava.struts.LoginAction and result success
>
> How can the struts.xml be configured to ignore the action or how can the convention plugin override the struts.xml? Do not want to add the LoginAction to the struts.xml

Can you post content of your struts.xml? I think you have defined a
main package and that's why such action isn't available.


Regards
-- 
Łukasz
+ 48 606 323 122 http://www.lenart.org.pl/

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


Re: convention plugin struts.xml interceptors

Posted by "ronald.a.andersen@gmail.com" <ro...@gmail.com>.

On 2016-10-30 18:53 (-0400), Martin Gainty <mg...@hotmail.com> wrote: 
> 
> 
> 
> ________________________________
> From: ronald.a.andersen@gmail.com <ro...@gmail.com>
> Sent: Sunday, October 30, 2016 1:59 PM
> To: user@struts.apache.org
> Subject: convention plugin struts.xml interceptors
> 
> My actions are working fine by following the convention rules - no struts.xml required; I need to configure a custom interceptor, so struts.xml is required. As soon as I add the struts.xml, the following exception is returned:
> 
> Oct 30, 2016 1:54:22 PM org.apache.struts2.dispatcher.Dispatcher error
> SEVERE: Exception occurred during processing request: No result defined for action net.codejava.struts.LoginAction and result success
> No result defined for action net.codejava.struts.LoginAction and result success
> 
> How can the struts.xml be configured to ignore the action or how can the convention plugin override the struts.xml? Do not want to add the LoginAction to the struts.xml
> 
> MG>use annotations
> 
> @Action("LoginAction") // actually that is not necessary as it is added by convention
> @Results(
>     @Result(name="success", location="/Success.jsp")
> )
> public class LogoninAction {
> MG>
> 
> 
> Struts2 version->struts2-core-2.3.15.1
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
> For additional commands, e-mail: user-help@struts.apache.org
> 
> Hi Martin,

It threw the same exception after adding the annotations; including my struts.xml file:

<?xml version="1.0" encoding="UTF-8"?>

<!DOCTYPE struts PUBLIC
	"-//Apache Software Foundation//DTD Struts Configuration 2.3//EN"
	"http://struts.apache.org/dtds/struts-2.3.dtd">
<struts>
	<!-- constant to define result path locations to project root directory -->
	<constant name="struts.convention.result.path" value="/"></constant>
	
	<package name="default" namespace="/" extends="struts-default">
        <interceptors>   
            <interceptor name="myCustomInterceptor" class="net.codejava.struts.MyCustomInterceptor" />
            <interceptor-stack name="customStack">
                <interceptor-ref name="myCustomInterceptor"/>
            </interceptor-stack>
        </interceptors>      
    </package>

</struts>

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


Re: convention plugin struts.xml interceptors

Posted by Ronald Andersen <ro...@gmail.com>.
Hi Martin,

It threw the same exception after adding the annotations; including my
struts.xml file:

<?xml version="1.0" encoding="UTF-8"?>

<!DOCTYPE struts PUBLIC
"-//Apache Software Foundation//DTD Struts Configuration 2.3//EN"
"http://struts.apache.org/dtds/struts-2.3.dtd">
<struts>
<!-- constant to define result path locations to project root directory -->
<constant name="struts.convention.result.path" value="/"></constant>
<package name="default" namespace="/" extends="struts-default">
        <interceptors>
            <interceptor name="myCustomInterceptor"
class="net.codejava.struts.MyCustomInterceptor" />
            <interceptor-stack name="customStack">
                <interceptor-ref name="myCustomInterceptor"/>
            </interceptor-stack>
        </interceptors>
    </package>

</struts>



On Sun, Oct 30, 2016 at 6:53 PM, Martin Gainty <mg...@hotmail.com> wrote:

>
>
>
> ________________________________
> From: ronald.a.andersen@gmail.com <ro...@gmail.com>
> Sent: Sunday, October 30, 2016 1:59 PM
> To: user@struts.apache.org
> Subject: convention plugin struts.xml interceptors
>
> My actions are working fine by following the convention rules - no
> struts.xml required; I need to configure a custom interceptor, so
> struts.xml is required. As soon as I add the struts.xml, the following
> exception is returned:
>
> Oct 30, 2016 1:54:22 PM org.apache.struts2.dispatcher.Dispatcher error
> SEVERE: Exception occurred during processing request: No result defined
> for action net.codejava.struts.LoginAction and result success
> No result defined for action net.codejava.struts.LoginAction and result
> success
>
> How can the struts.xml be configured to ignore the action or how can the
> convention plugin override the struts.xml? Do not want to add the
> LoginAction to the struts.xml
>
> MG>use annotations
>
> @Action("LoginAction") // actually that is not necessary as it is added by
> convention
> @Results(
>     @Result(name="success", location="/Success.jsp")
> )
> public class LogoninAction {
> MG>
>
>
> Struts2 version->struts2-core-2.3.15.1
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
> For additional commands, e-mail: user-help@struts.apache.org
>
>

Re: convention plugin struts.xml interceptors

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


________________________________
From: ronald.a.andersen@gmail.com <ro...@gmail.com>
Sent: Sunday, October 30, 2016 1:59 PM
To: user@struts.apache.org
Subject: convention plugin struts.xml interceptors

My actions are working fine by following the convention rules - no struts.xml required; I need to configure a custom interceptor, so struts.xml is required. As soon as I add the struts.xml, the following exception is returned:

Oct 30, 2016 1:54:22 PM org.apache.struts2.dispatcher.Dispatcher error
SEVERE: Exception occurred during processing request: No result defined for action net.codejava.struts.LoginAction and result success
No result defined for action net.codejava.struts.LoginAction and result success

How can the struts.xml be configured to ignore the action or how can the convention plugin override the struts.xml? Do not want to add the LoginAction to the struts.xml

MG>use annotations

@Action("LoginAction") // actually that is not necessary as it is added by convention
@Results(
    @Result(name="success", location="/Success.jsp")
)
public class LogoninAction {
MG>


Struts2 version->struts2-core-2.3.15.1

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