Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8001565
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 4, 20262026-06-04T16:07:29+00:00 2026-06-04T16:07:29+00:00

I am writing simple CRUD(Create, Remove ,Update ,Delete) application using Spring MVC and hibernate.

  • 0

I am writing simple CRUD(Create, Remove ,Update ,Delete) application using Spring MVC and hibernate.

In Create i can add membership start date in MM/dd/yyyy format.

In Update i want the same data to be display(populate) in my jsp.
My problem is at the time of update my date input field is showing date in yyyy-MM-dd format.
I find out the solution for this
At the time of getting values(in my model’s getter method) ,i have written one small code as below:

public Date getDateOfIncorporation() {
        Date date=null;
        try {
            Date abc = this.dateOfIncorporation;
            if (abc != null) {
                DateFormat df = new SimpleDateFormat("MM/dd/yyyy");
                String formattedDate = df.format(abc);
                date= df.parse(formattedDate);              
            }

        } catch (ParseException e) {
            e.printStackTrace();
        }
        return date;
    }

but i am confused about my approach .
is this the right way or am i doing any mistake by writing this code in form(model) .???

since i want to maintain good coding standard , i need your suggestions on the same.
is this acceptable , if any senior reviews my code …??

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-04T16:07:31+00:00Added an answer on June 4, 2026 at 4:07 pm

    actually it should be done in the view (i.e. your jsp) have a look at the JSTL format taglib:

    <%@ taglib uri="http://java.sun.com/jstl/fmt" prefix="fmt"%>
    

    and especially its pattern attribute (e.g. pattern="MM/dd/yyyy")

    <fmt:formatDate value="${yourDate}" pattern="MM/dd/yyyy" />
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I'm writing simple GUI using wxPyhon and faced some problems. My application does simple
Here's the situation: I'm writing a simple AJAX application that performs CRUD functions. When
I writing a simple method which should delete an entity from the database if
I'm writing a very simple CRUD app that takes user stories and stores them
I writing simple application that need to make some record of the incoming sound.
I'm currenlty using Asp.Net Dynamic Data, with Linq to Sql, to create an simple
I'm thinking of writing simple application for Windows Mobile devices, where user could simply
My web application currently has do execute simple queries: simple CRUD operations, counting,... A
As a part of learning process, I am writing simple IM app, using Remoting
I am writing simple client-server program. Client send some messages to server using UDP

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.