struts-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Ken McWilliams <ken.mcwilli...@gmail.com>
Subject Re: [Struts 2] How do I migrate an action with no result name to an annotation?
Date Fri, 02 Nov 2012 21:57:58 GMT
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 <ken.mcwilliams@gmail.com>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
> <result>/WEB-INF/jsp/myPage.
> jsp</result> those are implied.
>
>
> On Fri, Nov 2, 2012 at 3:27 PM, John Boyer <john@rodaxsoft.com> 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.
>>
>> <package name="default" extends="struts-default" namespace="/">
>>
>> <action name="myAction">
>>              <result>/WEB-INF/jsp/myPage.jsp</result>
>>     </action>
>> ...
>>
>> John
>>
>> On Nov 2, 2012, at 1:25 PM, Jeff Black <jeffrey.black@yahoo.com> 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 <john@rodaxsoft.com>
>> > To: Struts Users Mailing List <user@struts.apache.org>; Jeff Black <
>> jeffrey.black@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".
>> >
>> > <package name="default" extends="struts-default" namespace="/">
>> > ...
>> >
>> > 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 <jeffrey.black@yahoo.com>
>> wrote:
>> >
>> >> Double-check your namespace.  What is the class-name of your action
>> and the package?
>> >>
>> >> Jeff
>> >>
>> >>
>> >>
>> >> ________________________________
>> >> From: John Boyer <john@rodaxsoft.com>
>> >> To: Struts Users Mailing List <user@struts.apache.org>
>> >> 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.
>> >>
>> >>    <action name="start">
>> >>              <result>/WEB-INF/jsp/register.jsp</result>
>> >>     </action>
>> >>
>> >> 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-unsubscribe@struts.apache.org
>> >> For additional commands, e-mail: user-help@struts.apache.org
>> >
>> >
>> > ---------------------------------------------------------------------
>> > To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
>> > For additional commands, e-mail: user-help@struts.apache.org
>>
>>
>> ---------------------------------------------------------------------
>> To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
>> For additional commands, e-mail: user-help@struts.apache.org
>>
>>
>

Mime
  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message