-1

spring web flow sub subflow-state that open the same jsp my code is:

in jsp on click button:

$("#formid").get(0).setAttribute('action','search-comune.htm'); $("#formid").submit();

controller:

  @RequestMapping("/aut/nuovo-operatore-rer")
            public ModelMap start() {

            OperatoreRerVO opVO = new OperatoreRerVO();
            ModelMap model = new ModelMap();
            model.addAttribute("OperatoriRer",opVO);
            return model;
            }


         @RequestMapping(value = "/aut/search-comune", method = RequestMethod.POST)
            public ModelMap searchcomune(@ModelAttribute("OperatoriRer") OperatoreRerVO opVO) {
            List<Comuni> comuniList = new ArrayList <Comuni>() ;
            Comuni comune = new Comuni();
            String descrizione  = "%"+opVO.getComune().getDescrizione().toUpperCase()+"%";
            comuniList = comuniDao.selectByName(descrizione);
            ModelMap model = new ModelMap();
            model.addAttribute("comuniList",comuniList);
            model.addAttribute("OperatoriRer",opVO);
            return model;
            }

flow xml:

<view-state id="nuovo-operatore-rer" view="aut/nuovo-operatore-rer">
</view-state>
<view-state id="search-comune" view="aut/nuovo-operatore-rer" />

servlet

<webflow:flow-location id="aut/nuovo-operatore-rer" path="/WEB-INF/flows/aut/nuovo-operatore-rer.xml" />
        <webflow:flow-location id="aut/search-comune" path="/WEB-INF/flows/aut/nuovo-operatore-rer.xml" />

jsp name:nuovo-operatore-rer.jsp

doesn't work.

user1671106
  • 193
  • 1
  • 1
  • 9

1 Answers1

0

you flow needs to be separated in 2 if you want to be able to call them with different ids.
(btw the id of your flow doesn't have to be the same id as your view-state)

flow1 (aut/nuovo-operatore-rer.xml):

<view-state id="view1" view="aut/nuovo-operatore-rer">
</view-state>

flow2 (aut/search-comune.xml):

<view-state id="view2" view="aut/nuovo-operatore-rer">
</view-state>


<webflow:flow-location id="aut/nuovo-operatore-rer" path="/WEB-INF/flows/aut/nuovo-operatore-rer.xml" />
<webflow:flow-location id="aut/search-comune" path="/WEB-INF/flows/aut/search-comune.xml" />
rptmat57
  • 3,643
  • 1
  • 27
  • 38
  • But if I wanted to put "Ricerca-comune" in the same xml of "nuovo-OPERATORE-rer"? for example with sub-flow or transion? – user1671106 Jan 11 '13 at 13:40
  • to use a sub-flow you need a flow. so you would still have to define that flow in its own xml file – rptmat57 Jan 11 '13 at 15:00