Posts

Showing posts from March, 2017

Jhipster Settings Page Error

Jhipster accounts setting page is giving access denied and redirect to error page 

Solution : 
Add the below changes in your settings.route.ts file

 data: {     authorities: ['ROLE_USER','ROLE_MANAGER','ROLE_ACCOUNTANT'],     pageTitle: 'Settings'   }


in data authorities add your roles as above that will launch settings page when you login with that particular authority

Jhipster AngularJs2 Show Entities Based On ROLE_USER

How To Hide The Jhipster Entities Based On User roles ,For example some entities are not required to show normal users .That means we want to hide that particular entity when ever user logged in and his role is normal user ( ROLE_USER ) .

Follow the below steps to display or hide the entities based on user roles .
open navbar.component.html page which is present at the below path
\src\main\webapp\app\layouts\navbar\navbar.component.html

add the below condition for example
<ul class="dropdown-menu" ngbDropdownMenu> <li*jhiHasAnyAuthority="'ROLE_ADMIN'" uiSrefActive="active"> <a class="dropdown-item" routerLink="admin" (click)="collapseNavbar()"> <i class="fa fa-fw fa-asterisk" aria-hidden="true"></i> <span >Admin</span> </a> </li> <li *jhiHasAnyAuthority="['ROLE_ADMIN&…

How To Launch Index Html Using SpringBoot

Image
Index Html In Spring Boot Is Failing To Launch .
Solution : Change your Application.java class by extending SpringBootServletInitializer that will load the index.html at any folder inside resources lets say resources/htmlFiles/index.html
package hello; import org.springframework.boot.SpringApplication; import org.springframework.boot.autoconfigure.SpringBootApplication; import org.springframework.boot.builder.SpringApplicationBuilder; import org.springframework.boot.web.support.SpringBootServletInitializer; @SpringBootApplication class Application extends SpringBootServletInitializer{ @Override protected SpringApplicationBuilder configure(SpringApplicationBuilder application) { return application.sources(Application.class); } public static void main(String[] args) { SpringApplication.run(Application.class, args); } }


Angularjs2 Refresh Page Not Working

AngularJs2 #(hash) strategy will solve the problem

Solution : If you add the code in app.module.ts the refresh issue in angular js2 will be resolved
providers: [ {provide: LocationStrategy, useClass: HashLocationStrategy}, HttpModule ] The hash location strategy in router will append # at the end of the URL .