struts-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From mraible <>
Subject Re: Using the Restful2ActionMapper
Date Wed, 15 Aug 2007 22:25:50 GMT

I'm trying to change from using the old-style URLs to Restful2ActionMapper.
Here's what I've added to struts.xml:

    <bean name="struts2"
    <constant name="struts.mapper.composite"

I have a UserAction that does CRUD (below).

And the following action definitions:

        <!-- List of Users -->
        <action name="users" class="userAction" method="list">
            <result name="success">userList.jsp</result>
            <result name="input">userList.jsp</result>

        <!-- Edit User -->
        <action name="editUser" class="userAction" method="edit">
            <result name="success">userForm.jsp</result>
            <result name="input">userList.jsp</result>

        <!-- Save User -->
        <action name="saveUser" class="userAction">
            <result name="cancel" type="redirect">users.html</result>
            <result name="delete" type="redirect">users.html</result>
            <result name="input">userForm.jsp</result>
            <result name="success"

        <action name="saveUserWithValidation" class="userAction"
            <result name="input">userForm.jsp</result>
            <result name="success" type="redirect">users.html</result>

Is it possible to change to something like the following?

  <action name="user/*" className="userAction">

If so, I'm guessing I need to change some method names (i.e. the default
method for /user would be index, so I should change list() to index()) and
some result names (edit goes to "edit", save goes to "save", index goes to



Philip Lorenz-2 wrote:
>> Tomorrow's task for me is trying RESTful, so hopefully
>> you'll figure this out ;)
>> Do you need the ".action" in the URL?!
>> d.
> You can remove the action postfix by setting struts.action.extension to an
> empty string. I just left it enabled to have a clean default config with
> only the neccesary settings changed.
> Philip
> ---------------------------------------------------------------------
> To unsubscribe, e-mail:
> For additional commands, e-mail:

View this message in context:
Sent from the Struts - User mailing list archive at

To unsubscribe, e-mail:
For additional commands, e-mail:

View raw message