Charles Sexton

Ranch Hand
+ Follow
since Sep 26, 2013
Merit badge: grant badges
For More
Cows and Likes
Cows
Total received
0
In last 30 days
0
Total given
0
Likes
Total received
6
Received in last 30 days
0
Total given
82
Given in last 30 days
0
Forums and Threads
Scavenger Hunt
expand Ranch Hand Scavenger Hunt
expand Greenhorn Scavenger Hunt

Recent posts by Charles Sexton

So I have a project that I am working on and was wondering how to inject a container managed bean into a java class.....some things I have looked at is JNDI lookup using context which is pretty straight forward but what are the alternatives? Is JNDI Lookup the preferred way? I tried @Inject but I couldn't get it to work, seems like it only works for classes maintained by the container.....




This is the CategoryFacade Bean

Bear Bibeault wrote:That does not answer my question.



Because I have tried it and without the tags you end up with something like this.



Am I missing something? Newbie mistake somewhere.....?
7 years ago
JSP
does spring MVC or GWT allow you for example create a component such as


directory structure example
I was curious if anyone in the class knew of any tools, libraries, frameworks within Java EE that will minify and componentize (if thats a word) multiple css and js files.

For example: lets say you have a login.css and a index.css. You want to keep these separate to make them more modularized/componentized. The minification will remove any white space and try to compile everything to as less lines as possible for faster transmission of files. For example jquery.min.js is a minified version of jquery.

I get this idea from Angular.js. Angular is a very component based framework. Example, you would have a login component and the login component would have its own html, css and js files. The components are combined to build a single page which could be the main page of your website. I like this design as for large web applications it makes it easier to maintain different components of a web application. Plus it is also loosely coupled as its very easy to remove and add components throughout the web application. Component based web applications are becoming very much the future.

This approach is good if you have several components within an application. Login is just an example but you could very well have a slider or carousel component. The amount of components is completely dependent on the web application needs but its provides a more robust solution for web applications.

CSS Tricks intro to web components
https://css-tricks.com/modular-future-web-components/


In jsp you can include multiple html segments into specific jsp files using include.

Includes at compile time for dynamic data


Includes at runtime


I am curious on how to separate the css and js files in Java EE. Minify not necessary a requirement because you can always do this manually for the production environment but would be a plus if the tool, library or framework was able to do this.
I am using Glassfish and Netbeans....

Web.xml



index.jsp, also being served as a welcome-file


jspf




7 years ago
JSP
Why does the include-prelude require the HEAD, HTML and BODY tag? To me this is a design flaw. Why couldn't you just inject the markup for the ? Am I missing something that I am not aware of. I have seen quite a few frameworks allow for the markup to be injected.


7 years ago
JSP
So I was still struggling to get the ear file created after learning a little bit about Maven ear plugin. I got definitely a little closer on the weekend but hit a stump where the ear file wasn't even being created with the above pom.xml file. So i did more research and learned that a dynamic web project will only generate a war file in eclipse. I did more research started an enterprise application project in eclipse and saw that it literally created two modules and one project. I was confused as to how the pieces were put together. I played around with it for awhile but could never get the ear file generated. I came across this resource and wonder what you guys think about it. Is this a pretty optimal solution for creating an enterprise application in JEE? What if I wanted to add JMS, would that go in the war module for the servlet container?

resource for creating an ear project in eclipse with maven
Thank You, that fixed my problem but now introduced a new problem with the two servlets I have.....I will try to figure it out and if not ask another question.....
so after a fews of playing and trying to put the pieces together from the maven ear plugin docs.....I get a jar file after mvn package.....mvn package -X produces 0 errors.....

how do I get the ear file? Do I need to specify the jar and war module? Do I need to create an war and jar file dependency for the project using the artifact and groupd id?
what about Gradle, would you recommend Gradle over Maven?
I am struggling with learning how to use the maven ear plugin for a project that I am building. I have almost zero experience with plugins in maven. I tried looking at the documentation but in my opinion its definitely not the best....Does anyone have some good resources as I couldn't really find any that went in depth or could explain it here?
12 years later has the opinion of EJB changed since the release of version 3.*?
Never used Comparator either. I have used comparable several times before.
7 years ago