Results 1 to 10 of 12

Thread: Spring batch admin - set locale

Hybrid View

  1. #1
    Join Date
    Aug 2012
    Posts
    17

    Default Spring batch admin - set locale

    Hi all.

    I'd like to set the correct locale (pt_BR) in order to see the dates correctly.

    According to this issue (https://jira.springsource.org/browse/BATCHADM-29):

    Dave Syer added a comment - 03/Mar/10 10:08 PM

    Parameterized time zone in the controllers (defaults to VM locale). User can override by adding a bean definition called "userTimeZone" to servlet application context.
    But how can I do that? How do I register this bean? Can anyone give me an example?

    Thanks.

  2. #2
    Join Date
    Sep 2008
    Location
    Chicagoland, IL
    Posts
    348

    Default

    Give this a try:

    Code:
    <bean id="userTimeZone" class="java.util.TimeZone" factory-method="getTimeZone">
        <constructor-arg>America/Los_Angeles</constructor-arg>
    </bean>
    Michael Minella
    Spring Batch Lead
    Author - Pro Spring Batch
    http://www.michaelminella.com
    Twitter: @MichaelMinella

  3. #3
    Join Date
    Aug 2012
    Posts
    17

    Default

    Hi, thanks for your reply!

    I'm not sure where I should do this.

    1) META-INF/servlet/service-context.xml ?
    2) META-INF/spring/batch/override/app-context.xml?

    Thanks!

  4. #4
    Join Date
    Aug 2012
    Posts
    17

    Default

    Well, I've tried at META-INF/spring/batch/servlet/override/app-context.xml:

    <?xml version="1.0" encoding="UTF-8"?>
    <beans xmlns="http://www.springframework.org/schema/beans"
    xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
    xsi:schemaLocation="http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans-3.0.xsd">

    <bean id="userTimeZone" class="java.util.TimeZone" factory-method="getTimeZone">
    <constructor-arg value="America/Sao_Paulo" />
    </bean>

    </beans>

    But it did not solve my problem... any clue?

  5. #5
    Join Date
    Sep 2008
    Location
    Chicagoland, IL
    Posts
    348

    Default

    Put it in META-INF/spring/batch/override/app-context.xml.
    Michael Minella
    Spring Batch Lead
    Author - Pro Spring Batch
    http://www.michaelminella.com
    Twitter: @MichaelMinella

  6. #6
    Join Date
    Aug 2012
    Posts
    17

    Default

    Quote Originally Posted by mminella View Post
    Put it in META-INF/spring/batch/override/app-context.xml.
    Hi! Thanks for the reply.

    I did it, but it does not work...

    At admin, I see

    929 889 sBatchRenewJob 2012-10-09 20:29:12 00:00:08 COMPLETED COMPLETED

    and at database, I see

    929 2012-10-09 17:29:12.36

    Any clue?

Posting Permissions

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