Announcement Announcement Module
No announcement yet.
Read Multiple Input Files Page Title Module
Move Remove Collapse
Conversation Detail Module
  • Filter
  • Time
  • Show
Clear All
new posts

  • Read Multiple Input Files


    I am a total newbie with Spring Batch. I need to read 2 input files and write data to the database.

    My scenario:

    File A:
    A, B, C

    File B:

    I need to write AXXX, BYYY and CZZZ into the database.

    How do I read two different file?

    Any help will be highly appreciated!

  • #2
    problem with the Simple form controller

    I'm using Spring MVC, in the menu i have a link to update some informations, so i put a link to a page, and i configure the controller inherited from simpleformController, and in the method formBackingObject like this:

    protected Object formBackingObject(HttpServletRequest request) {

    ParameterList listParameters = new ParameterList();

    listParameters.setParameters(parameterManager.getA llParameters());

    return listParameters;

    i got the list and the values of theses informations, and when i want to update these information, i put the tratement in the method onSubmit :

    protected ModelAndView onSubmit(HttpServletRequest request,
    HttpServletResponse response, Object command, BindException errors)
    throws Exception {

    ParameterList listParameters = (ParameterList) command;
    List<Parameter> params = listParameters.getParameters();

    for (Parameter parmeter : params) {
    parameterManager.setParameter(ParameterCode.valueO f(parmeter
    .getParameterName()), parmeter.getParameterValue());

    return new ModelAndView("admin/Success");

    And the configuration of the servlet file is like this:

    <bean name="/admin/" class="net.maboite.web.controlleur.utils.ManagePar ametersControlleur">
    <property name="sessionForm" value="true" />
    <property name="commandName" value="listParameters" />
    <property name="commandClass"
    value="net.maboite.web.service.utils.ParameterList " />
    <property name="formView" value="admin/modifierParametres" />
    <property name="parameterManager" ref="ParameterServiceTarget" />

    all worsk perfectely when i click to the link on the menu,
    but the problème is when i want to open this page from another controller like this:

    return new ModelAndView("admin/modifierParametres", model);

    there is nothing.
    I tried with this instruction:

    return new ModelAndView(new InternalResourceView(""));

    but this instruction call the method formBackingObject and the method Onsubmit together.

    Thank you for your help


    • #3
      I have a page, containing a form used to display alot of informations to the user. There is also a set of actions (html buttons), used to dinamically change the 'action' field of the form to point to different URL's, depending on the action needed to be executed, and submit the form (through JavaScript). The actions are different and cannot be solved under the umbrella of a single controller.
      For some reasons, (i.e. one action will send alot of information to a controller, which outbounds the size of a normal GET request) the form method is POST. One of my actions is supposed to edit an entity displayed inside this form. This means will submit the form to it's own mapped url (destination controller) and send through POST method the entity ID. The destination controller (SimpleFormController) is supposed to lookup the entity on the curent session/load from database/create an empty one, use'it as form backing object and display an edit form.

      Here the problem is raising. Since the form method is POST, the SimpleFormController is tricked by this, and all the time will "skip" showing the edit form.

      Thank You !