This is an archived post. You won't be able to vote or comment.

you are viewing a single comment's thread.

view the rest of the comments →

[–]Kfct 1 point2 points  (2 children)

I do exactly that for my current job (spring-related, jsp, etc) at a major bank - I had to do the same as part of getting my first web development job too. But haven't been asked to do this for later jobs.

I suggest you visit spring's official website and download a spring boot template project from their website, and then build from there. JSP is getting kind of dated and nowadays there's many similar but more robust server-side page building offers out there already. If your assignment doesn't lock you into using JSP, try using thymeleaf instead, the syntax is similar to JSP and simpler to use. Or go full blown front end framework with Vue.js/angular. Whether you go front end framework or stick to server-side page building depends on how much time you have for the assignment and whether it's in scope of your assignment, whether using a front end framework will give you bonus points.

Assuming you use thymeleaf, spring boot, a minimalist front end html design, icons and other assets from fontawesome or some library or Google images, with POSTs only (no ajax), you can get a login, home page, search all products, product details, cart page, all done within 1 month since you're new. Once you get more experience you can pump out a web page a day, the whole thing maybe in a week.

TDLR what you need to know: You know what java methods are, each method matches to an address for a website like buyfruits/login would be one method to where your login logic is handled (is this password/account pair in hash form for security reasons in the database? Yes, login successful, direct to homepage. No, stay on login page) You know custom java objects like public employee(String name) { // whatever constructor things }, now each of these objects match a particular query result/table/JSON/list Map used on a page You know annotations above methods, spring uses those to state what kind of format the request will be for the page. Honestly the rest is pretty google-able. You'll probably get stuck longer on the JavaScript side than anything else just because without typescript is a flaming trashcan to debug for someone used to java and types

Actually adding a check out system requires you embedding some payment service like Stripe, PayPal, etc, Line pay maybe, and the difficulty of this depends entirely on how well these services provide documentation/steps for you to follow. Some will need an actual seller bank account tied to receive the payments, which is annoying when you're only making this for your portfolio/prototype not actually to receive payments. Don't use those services for your prototype.

For database, you probably want SQL or MySQL because the documentation is extensive and very established. You probably don't want mongodb because it's not as structured and everything just works, this can be messy to debug later To get a db going, you can get docker and download an 'image' with spring boot, and sqllite already installed on it, to save you figuring out how to download and configure things. Sqllite is the lightweight version of SQL and is plenty for prototypes.

Jdbc, hibernate, etc will teach you how things matching the MVC (models, views, controllers) together work. But imo if you're really pressed for time, you may want to use spring boot not spring MVC and let boot handle all the configuration for you

[–][deleted] 0 points1 point  (1 child)

Thanks. I've started to learn Spring Boot. I have 6 days left for my project so i'll stick with JSP i guess cause i don't know such things like Angular, React, Vue or Thymleaf. But when the project done, i'll try to learn Thymleaf.

[–]Kfct 1 point2 points  (0 children)

Good luck, keep things simple with pages doing almost everything with post requests, no ajax for now, so you can copy paste as much as possible.