Implementing in Struts2

前端 未结 1 1817
一个人的身影
一个人的身影 2021-01-24 02:06

I am currently working with a project, I have multiple select box in my application, each values should change according to the previous value selected in the first list, here i

1条回答
  •  一整个雨季
    2021-01-24 02:44

    There is a huge mess in your code. Keep in mind that:

    1. Each private property needs a Getter and a Setter (in some cases is possible to avoid them, but unless you know exactly what you are doing, always generate them); specifically, block in your bean and hospitalfloor in your action are missing them.
    2. I don't see your bean property defined anywhere, while in the JSP page you are referencing it several times (bean.state, bean.country etc).
    3. If you need to post something (and since you are posting the value from select1 to populate select2, you need it), you must put your elements inside a form. In the specific case of , don't put an action attribute in the form itself, because you are already specifying an action url from the href attribute of s:

      
           
           
           
           
           
       
      
    4. Your topics are not defined anywhere
    5. Your second select topics are recursively notifying the first select. This is wrong.

    The flow should be:

        
    
        
    

    0 讨论(0)
提交回复
热议问题