btw this is not related to tiles, it all applies to any plugin that
defines results.

musachy

On Wed, Jan 7, 2009 at 12:23 PM, Musachy Barroso <musa...@gmail.com> wrote:
> The "value" attribute needs to match the name of a package that is
> defined somewhere, if you do this:
>
> <constant name="struts.convention.default.parent.package" value="admin"/>
>
> make sure that your package is like
>
> <package name="admin">...</package>
>
> musachy
>
> On Wed, Jan 7, 2009 at 12:17 PM, Ercan Kayaonu <ekaya...@gmail.com> wrote:
>> Hi,
>> Sorry for disturbing you guys this much. Be sure that i first google to
>> solve the problem and read related parts of the documentation. But
>> unfortunately some of them are very concise. Anyways.
>>
>> I tried both
>>    <constant name="struts.convention.default.parent.package"
>> value="actions" />
>> and
>>    <constant name="struts.convention.default.parent.package" value="admin"
>> />
>> but I got this error: Unable to locate parent package [actions] - [unknown
>> location]   and this for second one.
>>                           Unable to locate parent package [admin] -
>> [unknown location]
>>
>> I also tried annotation method. My LoginAction.java class is already under
>> actions.admin package. (LoginAction.java is directly under admin package and
>> there's no other package under admin). so the parent class for this package
>> is i guess admin. Why do i have to set it again. For all my actions, the
>> default package is actions. But this didn't work also. I mean,     <constant
>> name="struts.convention.default.parent.package" value="actions" />.
>>
>> Quote: "To use a result, the action needs to be in the package that defines
>> the result"
>> Sorry, but could you please clarify what it mean to be "in the package that
>> defines the result". do you mean in struts.xml where we define
>> "result-types". I also tried changing those lines as follows
>>    <package name="default"  namespace="*actions.admin*"
>> extends="struts-default">
>>        <result-types>
>>            <result-type name="tiles"
>> class="org.apache.struts2.views.tiles.TilesResult" />
>>        </result-types>
>>     </package>
>> But no luck. My problem is playing with several setting blindly. I haven't
>> fully understood some of the concepts i guess. Documentations give examples
>> in a isolated manner. You can't relate to under parts of the system. For
>> example, from tiles plugin documentation
>>
>> <result-types>
>>    <result-type name="tiles"
>> class="org.apache.struts2.views.tiles.TilesResult"/>
>> </result-types>
>>
>> What should be the package name, namespace etc. there's no clue. I couldn't
>> find the solution in tiles.apache.org also.  Can someone advice a tutorial
>> on tiles and struts2 (step by step).
>>
>> Thanks for your efforts.
>>
>>
>> On Wed, Jan 7, 2009 at 4:30 PM, Musachy Barroso <musa...@gmail.com> wrote:
>>
>>> To use a result, the action needs to be in the package that defines
>>> the result, or in a package that extends the package where the result
>>> is defined.  There are several ways to fix this, in this case you can
>>> just set the parent package of the action, to your package:
>>>
>>> @ParentPackage("admin")
>>>
>>> or change the default parent package for all your actions (the ones
>>> configured by Convention):
>>>
>>> <constant name="struts.convention.default.parent.package" value="admin" />
>>>
>>> musachy
>>>
>>> On Wed, Jan 7, 2009 at 11:25 AM, Ercan Kayaonu <ekaya...@gmail.com> wrote:
>>> > Thank you Musachy,
>>> > That solved my problem, but
>>> > I got this error, which might be very familiar for most of you:
>>> >
>>> > The Result type [tiles] which is defined in the Result annotation on the
>>> > class [class actions.admin.LoginAction] or determined by the file
>>> extension
>>> > or is the default result type for the PackageConfig of the action, could
>>> not
>>> > be found as a result-type defined for the Struts/XWork package
>>> > [actions.admin#convention-default#/admin/login] - [unknown location]
>>> >
>>> > actions.admin.LoginAction.java:
>>> >
>>> >  @Action(value="/admin/login/index",result...@result(name="success",
>>> > type="tiles", location="admin.login") })   (I have definition in
>>> tiles.xml
>>> > for "admin.login".)
>>> >  public String execute() {
>>> >        return SUCCESS;
>>> >    }
>>> >
>>> > struts.xml :
>>> >    <package name="default"  namespace="/" extends="struts-default">
>>> >        <result-types>
>>> >            <result-type name="tiles"
>>> > class="org.apache.struts2.views.tiles.TilesResult" />
>>> >        </result-types>
>>> >     </package>
>>> >
>>> > Can anyone explain what name="default" stands for, because i changed it
>>> as
>>> > name="admin", i got the same error.
>>> > and also [actions.admin#convention-default#/admin/login] .  What is
>>> > #convention-default# ? Is it "actions" because convention plugin looks
>>> for
>>> > actions package. Or is it something we define in config files?
>>> > Thanks in advance.
>>> >
>>> >
>>> > On Wed, Jan 7, 2009 at 3:42 PM, Musachy Barroso <musa...@gmail.com>
>>> wrote:
>>> >
>>> >> You are missing dependencies, in this case Commons Digester
>>> >> (http://commons.apache.org/digester/)
>>> >>
>>> >> musachy
>>> >>
>>> >> On Wed, Jan 7, 2009 at 10:38 AM, Ercan Kayaonu <ekaya...@gmail.com>
>>> wrote:
>>> >> > Hi,
>>> >> > I'm using Struts 2.1.5 with convention plugin. I'm in the learning
>>> >> process
>>> >> > and trying several things (action, rule annotations, hibernate etc).
>>> >> > Everything was working ok until today.  i started using Tiles.
>>> >> > I copied
>>> >> >
>>> >> > struts2-tiles-plugin-2.1.5.jar
>>> >> > tiles-api-2.0.6.jar
>>> >> > tiles-core-2.0.6.jar
>>> >> > tiles-jsp-2.0.6.jar files into my lib folder. These files come with
>>> >> struts
>>> >> > 2.1.5.
>>> >> >
>>> >> > I added
>>> >> >    <listener>
>>> >> >
>>> >> >
>>> >>
>>> <listener-class>org.apache.struts2.tiles.StrutsTilesListener</listener-class>
>>> >> >    </listener>
>>> >> > to web.xml file.
>>> >> >
>>> >> > This is my struts.xml:
>>> >> > <struts>
>>> >> >    <package name="default" extends="struts-default">      (There was
>>> also
>>> >> > namespace="/", but later i removed it. but nothing changed)
>>> >> >        <result-types>
>>> >> >            <result-type name="tiles"
>>> >> > class="org.apache.struts2.views.tiles.TilesResult" />
>>> >> >        </result-types>
>>> >> >     </package>
>>> >> > </struts>
>>> >> >
>>> >> > I couldn't quite understand this package thing. Maybe the problem is
>>> with
>>> >> my
>>> >> > struts file. I can also paste tiles.xml if it is necessary to diagnose
>>> >> the
>>> >> > problem.
>>> >> > I get
>>> >> > HTTP Status 404 - /adv_ment/admin/login/index   problem. And these are
>>> >> the
>>> >> > lines from eclipse console:
>>> >> >
>>> >> > SEVERE: Exception sending context initialized event to listener
>>> instance
>>> >> of
>>> >> > class org.apache.struts2.tiles.StrutsTilesListener
>>> >> > java.lang.NoClassDefFoundError: org/apache/commons/digester/Rule
>>> >> >    at org.apache.tiles.definition.UrlDefinitionsFactory.init
>>> >> >    at
>>> >> > org.apache.tiles.impl.BasicTilesContainer.initializeDefinitionsFactory
>>> >> >    at org.apache.tiles.impl.BasicTilesContainer.init
>>> >> > ..............
>>> >> >
>>> >> > Thanks in advance. Sorry for keeping it long.
>>> >> >
>>> >>
>>> >>
>>> >>
>>> >> --
>>> >> "Hey you! Would you help me to carry the stone?" Pink Floyd
>>> >>
>>> >> ---------------------------------------------------------------------
>>> >> To unsubscribe, e-mail: user-unsubscr...@struts.apache.org
>>> >> For additional commands, e-mail: user-h...@struts.apache.org
>>> >>
>>> >>
>>> >
>>>
>>>
>>>
>>> --
>>> "Hey you! Would you help me to carry the stone?" Pink Floyd
>>>
>>> ---------------------------------------------------------------------
>>> To unsubscribe, e-mail: user-unsubscr...@struts.apache.org
>>> For additional commands, e-mail: user-h...@struts.apache.org
>>>
>>>
>>
>
>
>
> --
> "Hey you! Would you help me to carry the stone?" Pink Floyd
>



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

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

Reply via email to