Re: [Struts 2] How do I migrate an action with no result name to an annotation?
John -- Ken is right! Since you're using the Convention plugin just name your jsp accordingly. I have included a link to the plugin documentation for your convenience. Good luck! http://struts.apache.org/2.3.4/docs/convention-plugin.html Jeff From: Ken McWilliams To: Struts Users Mailing List ; Jeff Black Sent: Friday, November 2, 2012 5:38 PM Subject: Re: [Struts 2] How do I migrate an action with no result name to an annotation? Oh! With conventions you don't write any annotations! Simply create /WEB-INF/content/my-action.jsp then the action "my-action" will be found. You should stick to actions with hyphens as that is what conventions expects. You can't replace all of struts.xml with annotations. What Jeff proposes would work but, annotations work on code... in this case it does not makes sense to create code. So stick with the conventions, or use struts.xml. On Fri, Nov 2, 2012 at 4:03 PM, Jeff Black wrote: > John -- My wife accuses me of being dense all the time so forgive me. > > > I infer from your comments that you are using a pass-through action to > your jsp -- correct? > > If that is true, this works for me just fine: > > @Action(value = "start", > results = @Result(location = "/WEB-INF/testresult.jsp")) > public String dummy() { > return SUCCESS; > } > > A quote from the result-documentation[1]: > > * Likewise if the name attribute is not specified, the > framework will give it the name "success". > [1] http://struts.apache.org/2.3.1/docs/result-configuration.html > > > > > From: John Boyer > To: Struts Users Mailing List ; Jeff Black < > jeffrey.bl...@yahoo.com> > Sent: Friday, November 2, 2012 4:27 PM > Subject: Re: [Struts 2] How do I migrate an action with no result name to > an annotation? > > Hi Jeff: > > Yes, I'm using the plugin. Unfortunately, the documentation isn't really > helping or I'm missing some fundamental concept. Again, all my other > annotations work fine (INPUT, ERROR, SUCCESS) except for the action > described in this reply. > > To clarify, what I'd love to see is a simple example of how to migrate > "myAction", which has a result with no name from the default package and > namespace in the struts.xml into an annotation. Is this possible or does > this always need to stay in the struts.xml? This is the crux of my problem. > Thank you for your help. > > > > > /WEB-INF/jsp/myPage.jsp > > ... > > John > > On Nov 2, 2012, at 1:25 PM, Jeff Black wrote: > > > Hey there John. > > > > Are you using the Convention plugin? > > > > What is the classname of your action (e.g., > org.blackj.common.action.TestAction.java)? > > > > Jeff > > > > > > > > > > > > From: John Boyer > > To: Struts Users Mailing List ; Jeff Black < > jeffrey.bl...@yahoo.com> > > Sent: Friday, November 2, 2012 2:55 PM > > Subject: Re: [Struts 2] How do I migrate an action with no result name > to an annotation? > > > > Hi Jeff: > > > > In the struts.xml, the namespace is "/" and the package is "default". > > > > > > ... > > > > Do I need add this info as annotations to all my action classes? > > > > Thanks, > > > > John > > > > > > On Nov 2, 2012, at 12:11 PM, Jeff Black wrote: > > > >> Double-check your namespace. What is the class-name of your action and > the package? > >> > >> Jeff > >> > >> > >> > >> > >> From: John Boyer > >> To: Struts Users Mailing List > >> Sent: Friday, November 2, 2012 10:53 AM > >> Subject: [Struts 2] How do I migrate an action with no result name to > an annotation? > >> > >> Hi: > >> > >> I'm trying to move all of my action configurations out of the > struts.xml file into annotations. For the most part it's working fine. Yet, > for my actions that have results with no 'name' parameter it doesn't work. > For example, the following entry in my XML works perfectly. > >> > >> > >> /WEB-INF/jsp/register.jsp > >> > >> > >> However, when move this entry to my action class it doesn't work. I get > an "No result defined for action...and result input" error. What am I doing > wrong? I feel like I'm missing some fundamental concept here. My SUCCESS > and INPUT results work as expected. > >> > >> @Action(value = "start", results = > @Result(location="/WEB-INF/jsp/register.jsp")) > >> > >> Thank you, > >> > >> John Boyer > >> - > >> To unsubscribe, e-mail: user-unsubscr...@struts.apache.org > >> For additional commands, e-mail: user-h...@struts.apache.org > > > > > > - > > To unsubscribe, e-mail: user-unsubscr...@struts.apache.org > > For additional commands, e-mail: user-h...@struts.apache.org > > > - > To unsubscribe, e-mail: user-un
Re: [Struts 2] How do I migrate an action with no result name to an annotation?
Oh! With conventions you don't write any annotations! Simply create /WEB-INF/content/my-action.jsp then the action "my-action" will be found. You should stick to actions with hyphens as that is what conventions expects. You can't replace all of struts.xml with annotations. What Jeff proposes would work but, annotations work on code... in this case it does not makes sense to create code. So stick with the conventions, or use struts.xml. On Fri, Nov 2, 2012 at 4:03 PM, Jeff Black wrote: > John -- My wife accuses me of being dense all the time so forgive me. > > > I infer from your comments that you are using a pass-through action to > your jsp -- correct? > > If that is true, this works for me just fine: > > @Action(value = "start", > results = @Result(location = "/WEB-INF/testresult.jsp")) > public String dummy() { > return SUCCESS; > } > > A quote from the result-documentation[1]: > > * Likewise if the name attribute is not specified, the > framework will give it the name "success". > [1] http://struts.apache.org/2.3.1/docs/result-configuration.html > > > > > From: John Boyer > To: Struts Users Mailing List ; Jeff Black < > jeffrey.bl...@yahoo.com> > Sent: Friday, November 2, 2012 4:27 PM > Subject: Re: [Struts 2] How do I migrate an action with no result name to > an annotation? > > Hi Jeff: > > Yes, I'm using the plugin. Unfortunately, the documentation isn't really > helping or I'm missing some fundamental concept. Again, all my other > annotations work fine (INPUT, ERROR, SUCCESS) except for the action > described in this reply. > > To clarify, what I'd love to see is a simple example of how to migrate > "myAction", which has a result with no name from the default package and > namespace in the struts.xml into an annotation. Is this possible or does > this always need to stay in the struts.xml? This is the crux of my problem. > Thank you for your help. > > > > > /WEB-INF/jsp/myPage.jsp > > ... > > John > > On Nov 2, 2012, at 1:25 PM, Jeff Black wrote: > > > Hey there John. > > > > Are you using the Convention plugin? > > > > What is the classname of your action (e.g., > org.blackj.common.action.TestAction.java)? > > > > Jeff > > > > > > > > > > > > From: John Boyer > > To: Struts Users Mailing List ; Jeff Black < > jeffrey.bl...@yahoo.com> > > Sent: Friday, November 2, 2012 2:55 PM > > Subject: Re: [Struts 2] How do I migrate an action with no result name > to an annotation? > > > > Hi Jeff: > > > > In the struts.xml, the namespace is "/" and the package is "default". > > > > > > ... > > > > Do I need add this info as annotations to all my action classes? > > > > Thanks, > > > > John > > > > > > On Nov 2, 2012, at 12:11 PM, Jeff Black wrote: > > > >> Double-check your namespace. What is the class-name of your action and > the package? > >> > >> Jeff > >> > >> > >> > >> > >> From: John Boyer > >> To: Struts Users Mailing List > >> Sent: Friday, November 2, 2012 10:53 AM > >> Subject: [Struts 2] How do I migrate an action with no result name to > an annotation? > >> > >> Hi: > >> > >> I'm trying to move all of my action configurations out of the > struts.xml file into annotations. For the most part it's working fine. Yet, > for my actions that have results with no 'name' parameter it doesn't work. > For example, the following entry in my XML works perfectly. > >> > >> > >> /WEB-INF/jsp/register.jsp > >> > >> > >> However, when move this entry to my action class it doesn't work. I get > an "No result defined for action...and result input" error. What am I doing > wrong? I feel like I'm missing some fundamental concept here. My SUCCESS > and INPUT results work as expected. > >> > >> @Action(value = "start", results = > @Result(location="/WEB-INF/jsp/register.jsp")) > >> > >> Thank you, > >> > >> John Boyer > >> - > >> To unsubscribe, e-mail: user-unsubscr...@struts.apache.org > >> For additional commands, e-mail: user-h...@struts.apache.org > > > > > > - > > To unsubscribe, e-mail: user-unsubscr...@struts.apache.org > > For additional commands, e-mail: user-h...@struts.apache.org > > > - > To unsubscribe, e-mail: user-unsubscr...@struts.apache.org > For additional commands, e-mail: user-h...@struts.apache.org >
Re: [Struts 2] How do I migrate an action with no result name to an annotation?
John -- My wife accuses me of being dense all the time so forgive me. I infer from your comments that you are using a pass-through action to your jsp -- correct? If that is true, this works for me just fine: @Action(value = "start", results = @Result(location = "/WEB-INF/testresult.jsp")) public String dummy() { return SUCCESS; } A quote from the result-documentation[1]: * Likewise if the name attribute is not specified, the framework will give it the name "success". [1] http://struts.apache.org/2.3.1/docs/result-configuration.html From: John Boyer To: Struts Users Mailing List ; Jeff Black Sent: Friday, November 2, 2012 4:27 PM Subject: Re: [Struts 2] How do I migrate an action with no result name to an annotation? Hi Jeff: Yes, I'm using the plugin. Unfortunately, the documentation isn't really helping or I'm missing some fundamental concept. Again, all my other annotations work fine (INPUT, ERROR, SUCCESS) except for the action described in this reply. To clarify, what I'd love to see is a simple example of how to migrate "myAction", which has a result with no name from the default package and namespace in the struts.xml into an annotation. Is this possible or does this always need to stay in the struts.xml? This is the crux of my problem. Thank you for your help. /WEB-INF/jsp/myPage.jsp ... John On Nov 2, 2012, at 1:25 PM, Jeff Black wrote: > Hey there John. > > Are you using the Convention plugin? > > What is the classname of your action (e.g., > org.blackj.common.action.TestAction.java)? > > Jeff > > > > > > From: John Boyer > To: Struts Users Mailing List ; Jeff Black > > Sent: Friday, November 2, 2012 2:55 PM > Subject: Re: [Struts 2] How do I migrate an action with no result name to an > annotation? > > Hi Jeff: > > In the struts.xml, the namespace is "/" and the package is "default". > > > ... > > Do I need add this info as annotations to all my action classes? > > Thanks, > > John > > > On Nov 2, 2012, at 12:11 PM, Jeff Black wrote: > >> Double-check your namespace. What is the class-name of your action and the >> package? >> >> Jeff >> >> >> >> >> From: John Boyer >> To: Struts Users Mailing List >> Sent: Friday, November 2, 2012 10:53 AM >> Subject: [Struts 2] How do I migrate an action with no result name to an >> annotation? >> >> Hi: >> >> I'm trying to move all of my action configurations out of the struts.xml >> file into annotations. For the most part it's working fine. Yet, for my >> actions that have results with no 'name' parameter it doesn't work. For >> example, the following entry in my XML works perfectly. >> >> >> /WEB-INF/jsp/register.jsp >> >> >> However, when move this entry to my action class it doesn't work. I get an >> "No result defined for action...and result input" error. What am I doing >> wrong? I feel like I'm missing some fundamental concept here. My SUCCESS and >> INPUT results work as expected. >> >> @Action(value = "start", results = >> @Result(location="/WEB-INF/jsp/register.jsp")) >> >> Thank you, >> >> John Boyer >> - >> To unsubscribe, e-mail: user-unsubscr...@struts.apache.org >> For additional commands, e-mail: user-h...@struts.apache.org > > > - > To unsubscribe, e-mail: user-unsubscr...@struts.apache.org > For additional commands, e-mail: user-h...@struts.apache.org - To unsubscribe, e-mail: user-unsubscr...@struts.apache.org For additional commands, e-mail: user-h...@struts.apache.org
Re: [Struts 2] How do I migrate an action with no result name to an annotation?
Oh and please provide the full class name including package. You must have your action in a package that _ends_ with "action" or "struts2" (or struts I think). Otherwise the package structure which follows that string will be interpreted as part of the package structure. On Fri, Nov 2, 2012 at 3:55 PM, Ken McWilliams wrote: > I don't understand, your result always has a name. The default is > "success" and the type is by default "dispatcher". So when you simply write > /WEB-INF/jsp/myPage. > jsp those are implied. > > > On Fri, Nov 2, 2012 at 3:27 PM, John Boyer wrote: > >> Hi Jeff: >> >> Yes, I'm using the plugin. Unfortunately, the documentation isn't really >> helping or I'm missing some fundamental concept. Again, all my other >> annotations work fine (INPUT, ERROR, SUCCESS) except for the action >> described in this reply. >> >> To clarify, what I'd love to see is a simple example of how to migrate >> "myAction", which has a result with no name from the default package and >> namespace in the struts.xml into an annotation. Is this possible or does >> this always need to stay in the struts.xml? This is the crux of my problem. >> Thank you for your help. >> >> >> >> >> /WEB-INF/jsp/myPage.jsp >> >> ... >> >> John >> >> On Nov 2, 2012, at 1:25 PM, Jeff Black wrote: >> >> > Hey there John. >> > >> > Are you using the Convention plugin? >> > >> > What is the classname of your action (e.g., >> org.blackj.common.action.TestAction.java)? >> > >> > Jeff >> > >> > >> > >> > >> > >> > From: John Boyer >> > To: Struts Users Mailing List ; Jeff Black < >> jeffrey.bl...@yahoo.com> >> > Sent: Friday, November 2, 2012 2:55 PM >> > Subject: Re: [Struts 2] How do I migrate an action with no result name >> to an annotation? >> > >> > Hi Jeff: >> > >> > In the struts.xml, the namespace is "/" and the package is "default". >> > >> > >> > ... >> > >> > Do I need add this info as annotations to all my action classes? >> > >> > Thanks, >> > >> > John >> > >> > >> > On Nov 2, 2012, at 12:11 PM, Jeff Black >> wrote: >> > >> >> Double-check your namespace. What is the class-name of your action >> and the package? >> >> >> >> Jeff >> >> >> >> >> >> >> >> >> >> From: John Boyer >> >> To: Struts Users Mailing List >> >> Sent: Friday, November 2, 2012 10:53 AM >> >> Subject: [Struts 2] How do I migrate an action with no result name to >> an annotation? >> >> >> >> Hi: >> >> >> >> I'm trying to move all of my action configurations out of the >> struts.xml file into annotations. For the most part it's working fine. Yet, >> for my actions that have results with no 'name' parameter it doesn't work. >> For example, the following entry in my XML works perfectly. >> >> >> >> >> >> /WEB-INF/jsp/register.jsp >> >> >> >> >> >> However, when move this entry to my action class it doesn't work. I >> get an "No result defined for action...and result input" error. What am I >> doing wrong? I feel like I'm missing some fundamental concept here. My >> SUCCESS and INPUT results work as expected. >> >> >> >> @Action(value = "start", results = >> @Result(location="/WEB-INF/jsp/register.jsp")) >> >> >> >> Thank you, >> >> >> >> John Boyer >> >> - >> >> To unsubscribe, e-mail: user-unsubscr...@struts.apache.org >> >> For additional commands, e-mail: user-h...@struts.apache.org >> > >> > >> > - >> > To unsubscribe, e-mail: user-unsubscr...@struts.apache.org >> > For additional commands, e-mail: user-h...@struts.apache.org >> >> >> - >> To unsubscribe, e-mail: user-unsubscr...@struts.apache.org >> For additional commands, e-mail: user-h...@struts.apache.org >> >> >
Re: [Struts 2] How do I migrate an action with no result name to an annotation?
I don't understand, your result always has a name. The default is "success" and the type is by default "dispatcher". So when you simply write /WEB-INF/jsp/myPage. jsp those are implied. On Fri, Nov 2, 2012 at 3:27 PM, John Boyer wrote: > Hi Jeff: > > Yes, I'm using the plugin. Unfortunately, the documentation isn't really > helping or I'm missing some fundamental concept. Again, all my other > annotations work fine (INPUT, ERROR, SUCCESS) except for the action > described in this reply. > > To clarify, what I'd love to see is a simple example of how to migrate > "myAction", which has a result with no name from the default package and > namespace in the struts.xml into an annotation. Is this possible or does > this always need to stay in the struts.xml? This is the crux of my problem. > Thank you for your help. > > > > > /WEB-INF/jsp/myPage.jsp > > ... > > John > > On Nov 2, 2012, at 1:25 PM, Jeff Black wrote: > > > Hey there John. > > > > Are you using the Convention plugin? > > > > What is the classname of your action (e.g., > org.blackj.common.action.TestAction.java)? > > > > Jeff > > > > > > > > > > > > From: John Boyer > > To: Struts Users Mailing List ; Jeff Black < > jeffrey.bl...@yahoo.com> > > Sent: Friday, November 2, 2012 2:55 PM > > Subject: Re: [Struts 2] How do I migrate an action with no result name > to an annotation? > > > > Hi Jeff: > > > > In the struts.xml, the namespace is "/" and the package is "default". > > > > > > ... > > > > Do I need add this info as annotations to all my action classes? > > > > Thanks, > > > > John > > > > > > On Nov 2, 2012, at 12:11 PM, Jeff Black wrote: > > > >> Double-check your namespace. What is the class-name of your action and > the package? > >> > >> Jeff > >> > >> > >> > >> > >> From: John Boyer > >> To: Struts Users Mailing List > >> Sent: Friday, November 2, 2012 10:53 AM > >> Subject: [Struts 2] How do I migrate an action with no result name to > an annotation? > >> > >> Hi: > >> > >> I'm trying to move all of my action configurations out of the > struts.xml file into annotations. For the most part it's working fine. Yet, > for my actions that have results with no 'name' parameter it doesn't work. > For example, the following entry in my XML works perfectly. > >> > >> > >> /WEB-INF/jsp/register.jsp > >> > >> > >> However, when move this entry to my action class it doesn't work. I get > an "No result defined for action...and result input" error. What am I doing > wrong? I feel like I'm missing some fundamental concept here. My SUCCESS > and INPUT results work as expected. > >> > >> @Action(value = "start", results = > @Result(location="/WEB-INF/jsp/register.jsp")) > >> > >> Thank you, > >> > >> John Boyer > >> - > >> To unsubscribe, e-mail: user-unsubscr...@struts.apache.org > >> For additional commands, e-mail: user-h...@struts.apache.org > > > > > > - > > To unsubscribe, e-mail: user-unsubscr...@struts.apache.org > > For additional commands, e-mail: user-h...@struts.apache.org > > > - > To unsubscribe, e-mail: user-unsubscr...@struts.apache.org > For additional commands, e-mail: user-h...@struts.apache.org > >
Re: [Struts 2] How do I migrate an action with no result name to an annotation?
Hi Jeff: Yes, I'm using the plugin. Unfortunately, the documentation isn't really helping or I'm missing some fundamental concept. Again, all my other annotations work fine (INPUT, ERROR, SUCCESS) except for the action described in this reply. To clarify, what I'd love to see is a simple example of how to migrate "myAction", which has a result with no name from the default package and namespace in the struts.xml into an annotation. Is this possible or does this always need to stay in the struts.xml? This is the crux of my problem. Thank you for your help. /WEB-INF/jsp/myPage.jsp ... John On Nov 2, 2012, at 1:25 PM, Jeff Black wrote: > Hey there John. > > Are you using the Convention plugin? > > What is the classname of your action (e.g., > org.blackj.common.action.TestAction.java)? > > Jeff > > > > > > From: John Boyer > To: Struts Users Mailing List ; Jeff Black > > Sent: Friday, November 2, 2012 2:55 PM > Subject: Re: [Struts 2] How do I migrate an action with no result name to an > annotation? > > Hi Jeff: > > In the struts.xml, the namespace is "/" and the package is "default". > > > ... > > Do I need add this info as annotations to all my action classes? > > Thanks, > > John > > > On Nov 2, 2012, at 12:11 PM, Jeff Black wrote: > >> Double-check your namespace. What is the class-name of your action and the >> package? >> >> Jeff >> >> >> >> >> From: John Boyer >> To: Struts Users Mailing List >> Sent: Friday, November 2, 2012 10:53 AM >> Subject: [Struts 2] How do I migrate an action with no result name to an >> annotation? >> >> Hi: >> >> I'm trying to move all of my action configurations out of the struts.xml >> file into annotations. For the most part it's working fine. Yet, for my >> actions that have results with no 'name' parameter it doesn't work. For >> example, the following entry in my XML works perfectly. >> >> >> /WEB-INF/jsp/register.jsp >> >> >> However, when move this entry to my action class it doesn't work. I get an >> "No result defined for action...and result input" error. What am I doing >> wrong? I feel like I'm missing some fundamental concept here. My SUCCESS and >> INPUT results work as expected. >> >> @Action(value = "start", results = >> @Result(location="/WEB-INF/jsp/register.jsp")) >> >> Thank you, >> >> John Boyer >> - >> To unsubscribe, e-mail: user-unsubscr...@struts.apache.org >> For additional commands, e-mail: user-h...@struts.apache.org > > > - > To unsubscribe, e-mail: user-unsubscr...@struts.apache.org > For additional commands, e-mail: user-h...@struts.apache.org - To unsubscribe, e-mail: user-unsubscr...@struts.apache.org For additional commands, e-mail: user-h...@struts.apache.org
Re: [Struts 2] How do I migrate an action with no result name to an annotation?
Hey there John. Are you using the Convention plugin? What is the classname of your action (e.g., org.blackj.common.action.TestAction.java)? Jeff From: John Boyer To: Struts Users Mailing List ; Jeff Black Sent: Friday, November 2, 2012 2:55 PM Subject: Re: [Struts 2] How do I migrate an action with no result name to an annotation? Hi Jeff: In the struts.xml, the namespace is "/" and the package is "default". ... Do I need add this info as annotations to all my action classes? Thanks, John On Nov 2, 2012, at 12:11 PM, Jeff Black wrote: > Double-check your namespace. What is the class-name of your action and the > package? > > Jeff > > > > > From: John Boyer > To: Struts Users Mailing List > Sent: Friday, November 2, 2012 10:53 AM > Subject: [Struts 2] How do I migrate an action with no result name to an > annotation? > > Hi: > > I'm trying to move all of my action configurations out of the struts.xml file > into annotations. For the most part it's working fine. Yet, for my actions > that have results with no 'name' parameter it doesn't work. For example, the > following entry in my XML works perfectly. > > > /WEB-INF/jsp/register.jsp > > > However, when move this entry to my action class it doesn't work. I get an > "No result defined for action...and result input" error. What am I doing > wrong? I feel like I'm missing some fundamental concept here. My SUCCESS and > INPUT results work as expected. > > @Action(value = "start", results = > @Result(location="/WEB-INF/jsp/register.jsp")) > > Thank you, > > John Boyer > - > To unsubscribe, e-mail: user-unsubscr...@struts.apache.org > For additional commands, e-mail: user-h...@struts.apache.org - To unsubscribe, e-mail: user-unsubscr...@struts.apache.org For additional commands, e-mail: user-h...@struts.apache.org
Re: [Struts 2] How do I migrate an action with no result name to an annotation?
John: Give the Convention Plugin documentation a look: http://struts.apache.org/2.3.1/docs/convention-plugin.html Jeff From: Ken McWilliams To: Struts Users Mailing List Sent: Friday, November 2, 2012 3:21 PM Subject: Re: [Struts 2] How do I migrate an action with no result name to an annotation? Since you are using annotations I assume you are using the struts2-conventions-plugin? If so, then the package structure after "struts2" or "action" is taken to be the namespace. If this is not the case then you would need to override it. On Fri, Nov 2, 2012 at 1:55 PM, John Boyer wrote: > Hi Jeff: > > In the struts.xml, the namespace is "/" and the package is "default". > > > ... > > Do I need add this info as annotations to all my action classes? > > Thanks, > > John > > > On Nov 2, 2012, at 12:11 PM, Jeff Black wrote: > > > Double-check your namespace. What is the class-name of your action and > the package? > > > > Jeff > > > > > > > > > > From: John Boyer > > To: Struts Users Mailing List > > Sent: Friday, November 2, 2012 10:53 AM > > Subject: [Struts 2] How do I migrate an action with no result name to an > annotation? > > > > Hi: > > > > I'm trying to move all of my action configurations out of the struts.xml > file into annotations. For the most part it's working fine. Yet, for my > actions that have results with no 'name' parameter it doesn't work. For > example, the following entry in my XML works perfectly. > > > > > > /WEB-INF/jsp/register.jsp > > > > > > However, when move this entry to my action class it doesn't work. I get > an "No result defined for action...and result input" error. What am I doing > wrong? I feel like I'm missing some fundamental concept here. My SUCCESS > and INPUT results work as expected. > > > > @Action(value = "start", results = > @Result(location="/WEB-INF/jsp/register.jsp")) > > > > Thank you, > > > > John Boyer > > - > > To unsubscribe, e-mail: user-unsubscr...@struts.apache.org > > For additional commands, e-mail: user-h...@struts.apache.org > > > - > To unsubscribe, e-mail: user-unsubscr...@struts.apache.org > For additional commands, e-mail: user-h...@struts.apache.org > >
Re: [Struts 2] How do I migrate an action with no result name to an annotation?
Since you are using annotations I assume you are using the struts2-conventions-plugin? If so, then the package structure after "struts2" or "action" is taken to be the namespace. If this is not the case then you would need to override it. On Fri, Nov 2, 2012 at 1:55 PM, John Boyer wrote: > Hi Jeff: > > In the struts.xml, the namespace is "/" and the package is "default". > > > ... > > Do I need add this info as annotations to all my action classes? > > Thanks, > > John > > > On Nov 2, 2012, at 12:11 PM, Jeff Black wrote: > > > Double-check your namespace. What is the class-name of your action and > the package? > > > > Jeff > > > > > > > > > > From: John Boyer > > To: Struts Users Mailing List > > Sent: Friday, November 2, 2012 10:53 AM > > Subject: [Struts 2] How do I migrate an action with no result name to an > annotation? > > > > Hi: > > > > I'm trying to move all of my action configurations out of the struts.xml > file into annotations. For the most part it's working fine. Yet, for my > actions that have results with no 'name' parameter it doesn't work. For > example, the following entry in my XML works perfectly. > > > > > > /WEB-INF/jsp/register.jsp > > > > > > However, when move this entry to my action class it doesn't work. I get > an "No result defined for action...and result input" error. What am I doing > wrong? I feel like I'm missing some fundamental concept here. My SUCCESS > and INPUT results work as expected. > > > > @Action(value = "start", results = > @Result(location="/WEB-INF/jsp/register.jsp")) > > > > Thank you, > > > > John Boyer > > - > > To unsubscribe, e-mail: user-unsubscr...@struts.apache.org > > For additional commands, e-mail: user-h...@struts.apache.org > > > - > To unsubscribe, e-mail: user-unsubscr...@struts.apache.org > For additional commands, e-mail: user-h...@struts.apache.org > >
Re: [Struts 2] How do I migrate an action with no result name to an annotation?
Hi Jeff: In the struts.xml, the namespace is "/" and the package is "default". ... Do I need add this info as annotations to all my action classes? Thanks, John On Nov 2, 2012, at 12:11 PM, Jeff Black wrote: > Double-check your namespace. What is the class-name of your action and the > package? > > Jeff > > > > > From: John Boyer > To: Struts Users Mailing List > Sent: Friday, November 2, 2012 10:53 AM > Subject: [Struts 2] How do I migrate an action with no result name to an > annotation? > > Hi: > > I'm trying to move all of my action configurations out of the struts.xml file > into annotations. For the most part it's working fine. Yet, for my actions > that have results with no 'name' parameter it doesn't work. For example, the > following entry in my XML works perfectly. > > > /WEB-INF/jsp/register.jsp > > > However, when move this entry to my action class it doesn't work. I get an > "No result defined for action...and result input" error. What am I doing > wrong? I feel like I'm missing some fundamental concept here. My SUCCESS and > INPUT results work as expected. > > @Action(value = "start", results = > @Result(location="/WEB-INF/jsp/register.jsp")) > > Thank you, > > John Boyer > - > To unsubscribe, e-mail: user-unsubscr...@struts.apache.org > For additional commands, e-mail: user-h...@struts.apache.org - To unsubscribe, e-mail: user-unsubscr...@struts.apache.org For additional commands, e-mail: user-h...@struts.apache.org
Re: [Struts 2] How do I migrate an action with no result name to an annotation?
Double-check your namespace. What is the class-name of your action and the package? Jeff From: John Boyer To: Struts Users Mailing List Sent: Friday, November 2, 2012 10:53 AM Subject: [Struts 2] How do I migrate an action with no result name to an annotation? Hi: I'm trying to move all of my action configurations out of the struts.xml file into annotations. For the most part it's working fine. Yet, for my actions that have results with no 'name' parameter it doesn't work. For example, the following entry in my XML works perfectly. /WEB-INF/jsp/register.jsp However, when move this entry to my action class it doesn't work. I get an "No result defined for action...and result input" error. What am I doing wrong? I feel like I'm missing some fundamental concept here. My SUCCESS and INPUT results work as expected. @Action(value = "start", results = @Result(location="/WEB-INF/jsp/register.jsp")) Thank you, John Boyer - To unsubscribe, e-mail: user-unsubscr...@struts.apache.org For additional commands, e-mail: user-h...@struts.apache.org
[Struts 2] How do I migrate an action with no result name to an annotation?
Hi: I'm trying to move all of my action configurations out of the struts.xml file into annotations. For the most part it's working fine. Yet, for my actions that have results with no 'name' parameter it doesn't work. For example, the following entry in my XML works perfectly. /WEB-INF/jsp/register.jsp However, when move this entry to my action class it doesn't work. I get an "No result defined for action...and result input" error. What am I doing wrong? I feel like I'm missing some fundamental concept here. My SUCCESS and INPUT results work as expected. @Action(value = "start", results = @Result(location="/WEB-INF/jsp/register.jsp")) Thank you, John Boyer - To unsubscribe, e-mail: user-unsubscr...@struts.apache.org For additional commands, e-mail: user-h...@struts.apache.org
Re: Multi dimension array from form
Thanks Jeffrey, In the end I went with using a string representation of the array '[firstIndex][secondIndex][value]' and then used a tokenizer to recreate the array. It was pretty straight forward in the end. I don't know why but I thought I'd used multi dimensional arrays like that in the past but when I went back to look at some past projects, we hadn't. I think I was suffering a little delirium. Z. On 2/11/12 1:28 PM, "Jeffrey Black" wrote: >Z, > >Have a look at the following page: > >http://struts.apache.org/2.x/docs/html-form-buttons-howto.html > >I haven't worked through your use-case yet, but it may get you where you >want to be. I've used these techniques in my apps. > >Best, > >jb > > >On Nov 1, 2012, at 9:47 AM, Zoran Avtarovski >wrote: > >> I have a two dimension array in my action: >> >> Integer[][] dataArray with appropriate getter/setter. >> >> In my form I use the following checkbox tag to pass the data from user >>to >> action >> >>> status="typeStat"> >>> var="attribute" status="attStat"> >>> name="dataArray[%{#typeStat.index}][%{#attStat.index}]" >> label="%{#attribute.name}" fieldValue="%{#attribute.attributeId}"/> >> >> >> >> The form renders correctly in that the checkboxes are named >>dataArray[0][1] >> and so forth, but I can't the array form data into the array. >> >> Is there something I'm missing? I thought this was possible. >> >> I'd appreciate any help as the only other option I can see is to >>construct a >> string with a the multi dimension data and then token and construct the >> array in the action, which I'd rather not. >> >> Z. >> >> >> >> >> > >- >To unsubscribe, e-mail: user-unsubscr...@struts.apache.org >For additional commands, e-mail: user-h...@struts.apache.org > - To unsubscribe, e-mail: user-unsubscr...@struts.apache.org For additional commands, e-mail: user-h...@struts.apache.org
Re: Multi dimension array from form
Z, Have a look at the following page: http://struts.apache.org/2.x/docs/html-form-buttons-howto.html I haven't worked through your use-case yet, but it may get you where you want to be. I've used these techniques in my apps. Best, jb On Nov 1, 2012, at 9:47 AM, Zoran Avtarovski wrote: > I have a two dimension array in my action: > > Integer[][] dataArray with appropriate getter/setter. > > In my form I use the following checkbox tag to pass the data from user to > action > > status="typeStat"> > var="attribute" status="attStat"> > name="dataArray[%{#typeStat.index}][%{#attStat.index}]" > label="%{#attribute.name}" fieldValue="%{#attribute.attributeId}"/> > > > > The form renders correctly in that the checkboxes are named dataArray[0][1] > and so forth, but I can't the array form data into the array. > > Is there something I'm missing? I thought this was possible. > > I'd appreciate any help as the only other option I can see is to construct a > string with a the multi dimension data and then token and construct the > array in the action, which I'd rather not. > > Z. > > > > > - To unsubscribe, e-mail: user-unsubscr...@struts.apache.org For additional commands, e-mail: user-h...@struts.apache.org