Results 1 to 9 of 9
  1. #1
    Join Date
    Oct 2008
    Posts
    68
    Rep Power
    0

    Thumbs up Struts 2 and Ajax drop down Example

    Hi Experts,

    In our project we are using ejb3.0 and struts2.0.I need guide links to implement dependent drop down lists.can directly cal bean in javascript using Ajax,Struts 2 allows s:select tag to get list.if we use two lists,one list should be empty,means no values.i tried to give id and name property without list property.But it doesnt allow without list property in select tag.how can i implement using Ajax with Struts2,In google,i didnt get sample code for struts2.x with Ajax examples.

    ____________________________________________
    Priya,
    Cooking is Fun | Eat Healthy Stay Fit | Sweets | Raita | Bread | Dal

  2. #2
    piyu.sha is offline Member
    Join Date
    Oct 2008
    Posts
    31
    Rep Power
    0

    Default

    Why dont you look at the showcase application with Struts 2 distribution. I saw it had lots of good cool things already done in those demo apps.

    It also has a section for AJAX.

    Hope this helps.......
    Live life king size
    [Lucene]

  3. #3
    Join Date
    Oct 2008
    Posts
    68
    Rep Power
    0

    Default

    Yes I tried those, but I am not able to understand how it works. Need something simple to understand the basic of it first.

    Would appreciate any pointers or suggestions.
    ____________________________________________
    Priya,
    Cooking is Fun | Eat Healthy Stay Fit | Sweets | Raita | Bread | Dal

  4. #4
    kzvi.kzvi.1 is offline Member
    Join Date
    Oct 2008
    Location
    US
    Posts
    58
    Rep Power
    0

    Default

    I can understand the pain you are going through. Struts 2 has poor documentation and any search on google take me to struts 1 docs which are useless for strtus 2 application developers.

    Not sure if this is what you are looking for. Here is an example which shows how an AJAX drop down auto submit can be used in Struts 2.

    Let me know if this is what you are looking for.

    ____________________________________________
    Software Wiki | Interview FAQs | Lucene Search | Oracle | ORM | Struts2 | Job Seeker
    Have fun....
    JAVA FAQs

  5. #5
    Join Date
    Oct 2008
    Posts
    68
    Rep Power
    0

    Default

    Thanks a lot for the code snippet. It works. But I still dont understand whats happening behind the scene.

    I am confused now, where we should use struts 2 or not? as its getting more and more difficult when application is getting complex. And find very less information on web on it.

    ____________________________________________
    Priya,
    Cooking is Fun | Eat Healthy Stay Fit | Sweets | Raita | Bread | Dal

  6. #6
    kzvi.kzvi.1 is offline Member
    Join Date
    Oct 2008
    Location
    US
    Posts
    58
    Rep Power
    0

    Default

    May be its the time you should refer a good book.
    I found this on amazon, seems good read for 32bucks.
    Struts 2 Design and Programming

    ____________________________________________
    Software Wiki | Interview FAQs | Lucene Search | Oracle | ORM | Struts2 | Job Seeker
    Have fun....
    JAVA FAQs

  7. #7
    kzvi.kzvi.1 is offline Member
    Join Date
    Oct 2008
    Location
    US
    Posts
    58
    Rep Power
    0

    Default

    Just for others benifit,
    Here is another good book I would suggest for anyone struggling with Struts2

    Struts2 In Action
    Have fun....
    JAVA FAQs

  8. #8
    enger.fu is offline Member
    Join Date
    Jan 2010
    Posts
    3
    Rep Power
    0

    Default

    hello,everybody.I am Chinese,I do Java more than two years,I want to make a friend to learn Java together,My msn:fukailong@msn.com

  9. #9
    jogep is offline Member
    Join Date
    Dec 2009
    Location
    Germany
    Posts
    43
    Rep Power
    0

    Default

    Quote Originally Posted by priyanka.dandekar View Post
    how can i implement using Ajax with Struts2,In google,i didnt get sample code for struts2.x with Ajax examples.
    Struts 2.1.x brings a plugin out of the Box called Dojo Plugin.
    This Plugins provides you some easy AJAX functions like

    Java Code:
    <sx:div href="/myajax.action" />
    or

    Java Code:
    <sx:a href="/myajax.action" target="myajaxtargetdiv">Link</sx:a>
    But the Dojo Plugin is deprecated, so I recommend some of the other
    available plugins like the jQuery Plugin. :-)

    code.google.com/ p/ struts2-jquery/

    Take a look at the Showcase to see how it works.

Similar Threads

  1. Jsp with Ajax
    By sundarjothi in forum JavaServer Pages (JSP) and JSTL
    Replies: 16
    Last Post: 09-25-2008, 10:29 AM
  2. Replies: 0
    Last Post: 07-07-2008, 07:10 AM
  3. AJAX in JSP
    By haiforhussain in forum JavaServer Pages (JSP) and JSTL
    Replies: 8
    Last Post: 07-01-2008, 02:12 PM
  4. Example for Ajax-JSP
    By smrithi in forum JavaServer Pages (JSP) and JSTL
    Replies: 8
    Last Post: 06-02-2008, 02:00 PM
  5. How to use a drop-down box in Struts
    By piterskiy74 in forum Web Frameworks
    Replies: 1
    Last Post: 02-13-2008, 11:42 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
  •