Comments (19)
hi @rmpestano - Brazuca também 👍,
I have just got it working. Let me do more tests just to double check the best way to handle the Beans. Probably the AdminSession needs to be handled together with Spring Security.
Also, I am going to inject some real prime faces pages in the Template and let's see how it behaves.
Tomorrow I will try to check the admin-boot out and get the basics working, however I am not sure how to best externalise these configurations in the admin-boot for other people to reuse it.
Probably we need to declare the AdminBootStarter and the users trying to use the lib would need to extend this Java class.
So far so good!
Cheers!
from admin-template.
Hi @maxsap,
It it looks like an issue with OmniFaces dependency on CDI.
Looking at this thread it suggests OmniFaces 1.x to work with SpringBoot as it is "CDIless".
We could downgrade to OmniFaces 1.x in this project as well but there are other components that depend on CDI and may also break on a SpringBoot app.
I'm not a Spring expert but I think that is more a SpringBoot CDI integration issue.
The components of AdminTemplate that depend on CDI are the following:
AdminSession
BreadCrumbMB
LogoutMB
AdminConfig
SkinMB
from admin-template.
Hello @rmpestano,
Thank you for the fast response, indeed I am already using JoinFaces and tried to use your awesome template.
In an attempt to test out the template, I excluded the omnifaces version coming from adminfaces and now I am getting:
javax.faces.view.facelets.TagAttributeException: //Users/maxsap/Documents/workspace/wavy-admin/build/resources/main/META-INF/resources/index.xhtml @40,52 <ui:include src="/includes/top-bar.xhtml"> Invalid path : /includes/top-bar.xhtml
Which I am not 100% sure that its related to the CDI beans but more to where the resources are located.
After checking the beans that you specified it seems that most of them should be supported as spring should support @NamedBeans
natively but cannot handle @SessionScoped
Any chance we can work on a spring specific implementation? I am more than happy to help out.
from admin-template.
Hi @maxsap,
for the include issue I think there should be a missing "top-bar.xhtml" in 'includes' folder. Both top-bar and includes are in the showcase application, not a admin-template thing. Do you have /META-INF/resources/includes/top-bar.xhtml in your app?
About the SessionScoped handle I'm very open to add a spring boot compatible solution, have you already solved this issue before? Maybe we could use Java Service loader to solve this, just wondering.
from admin-template.
Hi @maxsap,
any news? do you have a sample project to share?
cheers!
from admin-template.
HI all,
I added the following bean in my main Application Class and it kinds of solve the issue to load the Admin-Template.
@Bean
public AdminConfig adminConfig() {
return new AdminConfig();
}
However I am still not able to get the template working. It looks like it renders the admin.xhtml as a template, however it does not find the source and images.
Did you have any progress on this one?
from admin-template.
Guys, I did some progress with the following for Spring Boot:
- For pom.xml:
- Installed the joinfaces in my project (version 2.4.0)
- Added admin-faces template to the project
-
For application.properties. This is important otherwise your server won't load the proper CSS:
jsf.primefaces.theme=admin
jsf.primefaces.font-awesome=true -
For SpringBootApplication.java starter, you need to tell SpringBoot to scan for the Beans and ServletComponents in the package:
@ComponentScan("com.github.adminfaces") //This will scan for the Beans in the Admin Faces lib.
@ServletComponentScan("com.github.adminfaces") // This will start the filter and servlets.
If you add ComponentScan, don't also forget to add your package to be also scanned. Mine has @ComponentScans for adminfaces and my package.
- Beans:
SpringBoot will complain that a Bean for the AdminSession has not been defined. Declare this in your application:
@Bean
public AdminSession adminSession() {
return new AdminSession();
}
If you want to configure the AdminConfig programatically like everything else in SpringBoot, you can also add the AdminConfig bean.
@Bean
public AdminConfig adminConfig() {
return new AdminConfig();
}
I didn't need to add the admin-faces.config file in the MEFA-INF, however you can also try it since I was able to verify that it loads properly once he ComponentScan is properly set.
I am still testing other aspects of this integration, however so far everything seems to work.
from admin-template.
Hi @alissongodoi, that's great news!
If everything is ok, would you mind to send a pull request to admin-boot?
Thank you very much for your help on this issue!
from admin-template.
É nóis hehe
So my ideia with admin-boot is to create the same admin-starter application so you can put your customization like AdminConfig bean there in some package like "config". We actually can rename it to "admin-starter-boot".
Later we can think of providing a spring-boot starter (I'm not familiar with boot ecosystem) or something users can declare as dependency in their projects, what do you think?
from admin-template.
I found a bizarre error with Maven.
If Maven Repository is located in a directory with space (like windows 7 First name and Surname folder schema), the code fails to locate the /admin.xhtml template.
When I moved the Maven Repository to a folder without spaces (for example, c:\m2-repo), it worked properly.
It was giving:
Invalid path : /admin.xhtml
at com.sun.faces.facelets.tag.ui.CompositionHandler.apply(CompositionHandler.java:179)
at com.sun.faces.facelets.compiler.NamespaceHandler.apply(NamespaceHandler.java:93)
at com.sun.faces.facelets.compiler.EncodingHandler.apply(EncodingHandler.java:87)
at com.sun.faces.facelets.impl.DefaultFacelet.include(DefaultFacelet.java:312)
at com.sun.faces.facelets.impl.DefaultFacelet.include(DefaultFacelet.java:371)
at com.sun.faces.facelets.impl.DefaultFacelet.include(DefaultFacelet.java:350)
at com.sun.faces.facelets.impl.DefaultFaceletContext.includeFacelet(DefaultFaceletContext.java:199)
at com.sun.faces.facelets.tag.ui.CompositionHandler.apply(CompositionHandler.java:174)
at com.sun.faces.facelets.compiler.NamespaceHandler.apply(NamespaceHandler.java:93)
at com.sun.faces.facelets.compiler.EncodingHandler.apply(EncodingHandler.java:87)
at com.sun.faces.facelets.impl.DefaultFacelet.apply(DefaultFacelet.java:161)
at com.sun.faces.application.view.FaceletViewHandlingStrategy.buildView(FaceletViewHandlingStrategy.java:1006)
at com.sun.faces.lifecycle.RenderResponsePhase.execute(RenderResponsePhase.java:99)
at com.sun.faces.lifecycle.Phase.doPhase(Phase.java:101)
at com.sun.faces.lifecycle.LifecycleImpl.render(LifecycleImpl.java:219)
at javax.faces.webapp.FacesServlet.service(FacesServlet.java:659)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:231)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:166)
at org.apache.tomcat.websocket.server.WsFilter.doFilter(WsFilter.java:52)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:193)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:166)
from admin-template.
Hi, that's really weird because template resolution is done at runtime (e.g when user access a page on browser) and maven resolves dependencies at build time.
So the only thing that comes to mind is that using a folder with spaces on maven repo you were not downloading dependencies during build...
from admin-template.
Hello good afternoon! I'm having the same probrema using JSF with maven. But I can not solve it yet.
from admin-template.
Hi, have you looked into admin-starter-springboot project?
from admin-template.
from admin-template.
Which components? What's the error?
from admin-template.
from admin-template.
Actually I'm working on a project outside the template,
The breadcrumb component depends on admin-template, don't know how I could help if you can't use the template. You can look into the code and try to extract its logic from BreadCrumbMB.
from admin-template.
from admin-template.
Hello
I get the below message any advice when using war with tomcat server
com.github.adminfaces.template.session.AdminFilter
java.lang.IllegalStateException: Unable to locate CDIProvider
from admin-template.
Related Issues (20)
- Admin properties labels HOT 2
- na
- Upgrade to PrimeFaces 10
- ADMIN LTE 3 support
- Migrate CI/CD to github actions
- Error FileUpload HOT 4
- syncax error in filea admintemplate.js HOT 1
- Provide a Jakarta EE 9 version HOT 8
- Error while loading breadcrumb HOT 1
- Updates bootstrapt to 3.4.1
- Web session cluster is not working HOT 2
- Support javax package
- Failure to compile against admin-template 1.5.1 HOT 3
- Update to Java 11 HOT 1
- Adminfaces 1.6.0 is not Jakarta EE 9 Compatible HOT 8
- Automate the release of javax & jakarta artifacts HOT 1
- Consider different branch for "jakarta" and "javax" releases HOT 1
- Drop javax support
- error with mvn compile
- Como eu faço para utilizar essa ultima versão com o spring boot?
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from admin-template.