struts-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Lukasz Lenart" <lukasz.len...@googlemail.com>
Subject Re: [Struts2] Convention Plugin
Date Sat, 07 Jun 2008 09:15:53 GMT
Hi,

You have to configure struts to tell where your actions are:

    <filter>
        <filter-name>action2</filter-name>

<filter-class>org.apache.struts2.dispatcher.FilterDispatcher</filter-class>
        <init-param>
            <param-name>actionPackages</param-name>
            <param-value>your.package.actions</param-value>
        </init-param>
    </filter>


Action class must pass such name convention ActionNameAction.class, eg.
EmployeeAction will be mapped as a employee.action,
namespace will be created base on package prefix, eg.
your.package.actions.employee.AddAction will give add.action in namespace
/employee
The same convention is for results, eg. if employee.action return success it
will be mapped to employee-success.jsp

I also have such settings in my struts.properties but I don't know which
version do you use
struts.convention.action.packages = you.package.actions
struts.convention.result.path = / <-- where to search you jsp files



Regards
-- 
Lukasz
http://www.lenart.org.pl/

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