Results 1 to 5 of 5

Thread: struts2

  1. #1
    catchme33 is offline Member
    Join Date
    Feb 2009
    Posts
    1
    Rep Power
    0

    Default struts2

    Hi frnds,
    this is first time im using this forum
    i m totally new to Struts and directly working on Struts2 w/o knowing much abt Struts .
    so want some help
    my prob is in my application
    after login , based on user (like Admn/User/ etc..) i want to redirect to diffrent Actions
    like
    for Admin -- it should go to Loginaction with fullAdmin rights
    for user --- it should go to another action with some rights and so on
    settign permissions is another concern
    but wht i want to know is how to redirect to seprate Actions.

    i hope u get my point
    so plz help if possible ASAP
    catchme33@gmail.com

  2. #2
    mtyoung is offline Senior Member
    Join Date
    Dec 2008
    Location
    Hong Kong
    Posts
    473
    Rep Power
    6

    Default

    after login....
    for Admin -- it should go to Loginaction ...
    why after login, users need to go to LoginAction again?

  3. #3
    mtyoung is offline Senior Member
    Join Date
    Dec 2008
    Location
    Hong Kong
    Posts
    473
    Rep Power
    6

    Default

    <action method='aAction' class="xxx" ...>
    <result name="admin">location</result>
    <result name="user">location</result>
    <result name="fail">location</result>
    </action>

    where admin, user, fail are String returned by aAction method in class xxx

    result tag can add type="redirect", "redirectAction" etc...

  4. #4
    Steve11235's Avatar
    Steve11235 is offline Senior Member
    Join Date
    Dec 2008
    Posts
    1,046
    Rep Power
    7

    Default

    You can't use a framework without understanding it. Go to the Struts site and go to Struts 2. It is *totally* different from Struts 1. They have a PDF book that describes Struts 2. Start by reading that.

  5. #5
    arseny is offline Member
    Join Date
    Mar 2009
    Posts
    25
    Rep Power
    0

    Default

    Joining to mtyong. You are spiting your action in a couple actions. The first one validates login input and defines if the input correct and user is admin (action returns a string for the admin action) or a simple user (action returns a string for the user action).

Similar Threads

  1. Difference between struts1 and struts2
    By radhika123 in forum Advanced Java
    Replies: 1
    Last Post: 10-30-2008, 11:04 AM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •