struts action url mapping that allows to split actions into restricted and unrestricted

Discussion in 'Java' started by Pavel, Nov 13, 2003.

  1. Pavel

    Pavel Guest

    Greetings to all -

    How could I have two groups of struts actions in the same application
    so the actions in the first group require the container based
    authorization and actions in the second group do not ?

    According to http://jakarta.apache.org/struts/userGuide/configuration.html
    I can use either prefix matching or extension matching:

    5.4.2 Configure the Action Servlet Mapping
    WARNING - Struts will not operate correctly if you define more than
    one <servlet-mapping> element for the controller servlet.

    In my web.xml I could not specify 'exception' url-pattern either:

    <security-constraint>
    <web-resource-collection>
    <url-pattern>*.do</url-pattern>
    <url-pattern>/jsp/*</url-pattern>
    </web-resource-collection>
    </security-constraint>

    If struts would support multiple servlet-mapping then I could use
    /do/* for my unrestricted actions. Can I have different url mapping
    for different struts modules ?

    The only work around that comes to mind so far is to create servlets
    outside of struts framework instead of actions in one of two groups.
    Any ideas are greatly appreciated.

    Thanks
    Pavel
     
    Pavel, Nov 13, 2003
    #1
    1. Advertising

  2. Pavel

    Pavel Guest

    I could probably change my struts action servlet mapping from '*.do'to
    '/do/*' and then modify all of my secure actions mapping from '/dada'
    to '/do/secure/dada' in struts-config.xml. I could then add unsecure
    struts action '/do/public/dada'.

    In web.xml, I could then use '/do/secure/*' instead of '/do/*'. The
    downside of this is that I'd have to go though all of the JSPs and
    replace 'dada.do' with '/do/secure/dada' for all of the actions. Also,
    according to Struts docs 5.4.2 Configure the Action Servlet Mapping:
    WARNING - If you are using the new module support in Struts 1.1, you
    should be aware that only extension mapping is supported.

    If I could only specify the exceptions in the web.xml like
    <security-constraint>
    <web-resource-collection>

    <url-pattern-except>/public/*</url-pattern-except>

    <url-pattern>*.do</url-pattern>
    <url-pattern>/jsp/*</url-pattern>
    </web-resource-collection>
    </security-constraint>
    that would be all I'd need to do ... It would be too simple though.

    Pavel

    (Pavel) wrote in message news:<>...
    > Greetings to all -
    >
    > How could I have two groups of struts actions in the same application
    > so the actions in the first group require the container based
    > authorization and actions in the second group do not ?
    >
    > According to http://jakarta.apache.org/struts/userGuide/configuration.html
    > I can use either prefix matching or extension matching:
    >
    > 5.4.2 Configure the Action Servlet Mapping
    > WARNING - Struts will not operate correctly if you define more than
    > one <servlet-mapping> element for the controller servlet.
    >
    > In my web.xml I could not specify 'exception' url-pattern either:
    >
    > <security-constraint>
    > <web-resource-collection>
    > <url-pattern>*.do</url-pattern>
    > <url-pattern>/jsp/*</url-pattern>
    > </web-resource-collection>
    > </security-constraint>
    >
    > If struts would support multiple servlet-mapping then I could use
    > /do/* for my unrestricted actions. Can I have different url mapping
    > for different struts modules ?
    >
    > The only work around that comes to mind so far is to create servlets
    > outside of struts framework instead of actions in one of two groups.
    > Any ideas are greatly appreciated.
    >
    > Thanks
    > Pavel
     
    Pavel, Nov 14, 2003
    #2
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. rjweytens
    Replies:
    6
    Views:
    16,102
    rjweytens
    Jun 25, 2004
  2. runescience

    Struts mapping action to action???

    runescience, Feb 6, 2006, in forum: Java
    Replies:
    3
    Views:
    1,830
    runescience
    Feb 7, 2006
  3. ros
    Replies:
    0
    Views:
    604
  4. Andrew Thompson

    'Unrestricted' option of the AppletViewer.

    Andrew Thompson, Jun 20, 2009, in forum: Java
    Replies:
    2
    Views:
    572
    Andrew Thompson
    Jun 21, 2009
  5. weberh

    script for unrestricted permutation

    weberh, Jul 2, 2003, in forum: Perl Misc
    Replies:
    11
    Views:
    157
    Chris Charley
    Jul 14, 2003
Loading...

Share This Page