Posts

Showing posts from July, 2020

Using jsp file in SpringBoot

<!-- https://mvnrepository.com/artifact/org.apache.tomcat.embed/tomcat-embed-jasper --> <dependency>     <groupId>org.apache.tomcat.embed</groupId>     <artifactId>tomcat-embed-jasper</artifactId>     <version>9.0.37</version> </dependency> Insert this dependency or search which version is present in the application i.e tomcat annotation version, then download the same version

IntelliJ IDEA - Running tomcat in two seperate port

Image
Change the http port and jmx port

Starting with Restful api in intellij

Image
while creating project, First Select the web application and restful api like in the pic. Then Create two class like in the pic If this is not working see the video in this link https://www.youtube.com/watch?v=7tq1jOXuRTA //////////////Above method is shown in official jetbrain page But it doesnot work for me/////////////////// Another way of doing it is: -->Create a project with maven,  -->select create archetype. -->select org.glassfish.jersey.archetype:jersey.quickstart.webapp -->select jersey.quickstart.webapp:2.31 -->GiveName and finish -->Configure tomcat in edit configuration and run  

Spring Form, DAO with Spring

Required tag lib for spring form to be used <%@ taglib prefix =" c " uri =" http://java.sun.com/jsp/jstl/core " %> <%@ taglib prefix =" form " uri =" http://www.springframework.org/tags/form " %> This is how form is used for spring < form :form action ="displayUserInfo" modelAttribute ="user" > Name:< form :input path ="name" required ="true" placeholder ="Enter your name" /> < p /> < form :errors path ="name" cssStyle ="color: red" /> Gender Male: < form :radiobutton path ="gender" value ="male" /> < p /> female: < form :radiobutton path ="gender" value ="female" /> < p /> Country: < form :select path ="country" > < form :option value ="India" /> < form :option value ="China" /> < form :option

Tomcat Server couldnot start error

Error: More  than one fragment with the name [spring_web] was found ,  consider using                       absolute ordering.  It is because of dependicies conflict, Clean the project i.e clean it from the tomcat server:  TO do this: go to maven, life cycle and clean

AceJump Problem

Ace jump not opening ctrl + shift + ;  -> won't work. so you have to go to keymap and search the acejump, and add the shortcut ctrl + shift + ; by simply pressing these buttons.  

Errors for UnsatisfiedDependence, access denied for root@localhost with no password.

Error    ( org.springframework.beans.factor.UnsatisfiedDependence )                        ( java.lang.ClassNotFoundException: Could not load requested class : org.hibernate.dialect.mySQL5Dialect ) Solution: org.springframework.beans.factory.UnsatisfiedDependencyException: Error creating bean with name 'profileController' defined in URL         This error was cause because i made the spring.jpa.properties.hibernate.dialect = org.hibernate.dialect. m ySQL5Dialect,  the problem was m should be M.   Error    ( Access denied for user ''@'localhost' (using password: NO) spring-boot ) Even though there was password for  my root. Solution:   Use the correct spelling for spring.datasource.password=  

Changing the dark theme for mysql workbench

Go in the file code_editor.xml , inside folder /usr/share/mysql-workbench/data Paste the below code inside <language name="SCLEX_MYSQL"> <!-- dark-gray: #282828; brown-gray: #49483E; gray: #888888; light-gray: #CCCCCC; ghost-white: #F8F8F0; light-ghost-white: #F8F8F2; yellow: #E6DB74; blue: #66D9EF; pink: #F92672; purple: #AE81FF; brown: #75715E; orange: #FD971F; light-orange: #FFD569; green: #A6E22E; sea-green: #529B2F; --> <style id = "32" fore-color-light = "#DDDDDD" back-color-light = "#282828" fore-color-dark = "#DDDDDD" back-color-dark = "#282828" bold = "No" /> <!-- STYLE_DEFAULT !BACKGROUND! --> <style id = "33" fore-color-light = "#DDDDDD" back-color-light = "#282828" fore-color-dark = "#DDD