Closed. This question needs to be more focused. It is not currently accepting answers.
Want to improve this question? Update the question so it focuses on one problem only by editing this post.
Closed 7 years ago.
Improve this question
Recently i have made a simple database project with the help of jsp and servlet. I have done lot of the work in the jsp layouts and servelt. It has around 30 jsp files. But due to lot of repeated code for the connectivity files to database it has been very complex. I want to reduce this complexity by managing the code.
I've heard about Hibernate framework which is used for database connectivity for make the project simple and unrepeated code. Now i want to convert this same project with hibernate. Is it possible? And where from i should need to start?
Yes it should be possible, however, what seems to be the issue is this:
I have done lot of the work in the jsp layouts and servlet.
You also mention that you have a lot of repeated code.
You would probably need to consider to encapsulate the database operations and move them from the JSP pages (if I am understanding your point correctly) to appropriate bean classes. You would then call these beans from your JSP pages. This should reduce code duplication, thus making your application more maintainable.
After this refactoring process, you can proceed and implement the Hibernate framework within your system.
Related
Closed. This question needs to be more focused. It is not currently accepting answers.
Want to improve this question? Update the question so it focuses on one problem only by editing this post.
Closed 6 years ago.
Improve this question
What is the best solution to configure rdf/owl database for spring web mvc applications?
I am searching a solution to orm for owl in spring application.
Have you looked into Stardog? I'm not sure what your exact goal is with the database, but this is what I use for creating/accessing/querying/etc. triple stores programmatically. They have an API called SNARL - here is a good example of how to use it with Java. They actually have a section in their docs for Spring Programming and use some different beans. I use a combination of the spring programming (for querying) and the method in the first link (for setting up dbs and loading files).
Downside is OWL/XML and Owl Functional Syntax are not supported file formats, but you can just convert your file to RDF/XML (esp. easy if you're using Protege). If you're not using Protege, there are other ways to do it.
If you have any further questions I'm happy to help out.
Closed. This question is opinion-based. It is not currently accepting answers.
Want to improve this question? Update the question so it can be answered with facts and citations by editing this post.
Closed 9 years ago.
Improve this question
I have the first meeting with my project manager and she assigned me a project which to be start soon. She explained to me few points related project e.g. technology, functionality, end user expectation etc.
MVC based web application
Not to use any framework
Server Side : use only Java, servlet, jsp
UI : Javascript, jQuery can also be used
integratation with existing project (at later stage)
There is one point i can not understand why she asked me to not to use any framework although i could not ask why. Does anybody clarify ? If i use any framework like spring then will it create any problem while integration with existing project.
I can recognize 2 sub questions in your question.
In what scenario the framework should not be used?
why she asked me to not to use any framework?
Answer 1
I can imagine situation when you don't need any framework. It is if you have to create extremely simple 1-2 screen application without any security, access rules and probably without DB based persistence. This means that IMHO framework-less application is good as a student exercise just to understand how things work.
Answer 2
She is ... not professional enough. I am sorry to say it but this is pretty obvious. To implement MVC without framework you have to perform a lot of dirty work. I believe that the key reason for this strange requirement is "integratation with existing project" that is probably created without any framework, so PM thinks that framework could bother you during this integration.
Moreover, product manager should never dictate R&D how to implement project. Project manager can politely ask to implement certain set of features.
I am sorry if my answer is helpful.
Closed. This question needs to be more focused. It is not currently accepting answers.
Want to improve this question? Update the question so it focuses on one problem only by editing this post.
Closed 9 years ago.
Improve this question
I am new to JSF and, I need to make my JSF Application to be a web service server. Is this possible? And, if it is, can you please help me how to do it?
(Please keep in mind that this is a BAD IDEA anyway, so the answer will look like one as well)
Create a form with JSF. As soon as it works as expected use your second web app to GET the form HTML code, parse it and POST your parameters with the form.
If you created your JSF form well enough it will be sufficiently consistent that you can skip the GET and directly use the POST.
You could also use some third-party library to do the parsing and filling of the form for you. (But that does not make the idea any better)
Before you do that read about RESTful, JSON and most importanly Servlet. What they do, when to use them and realize that your approach is most likely not going to produce good, reliable, maintainable code.
DON'T DO IT THIS WAY (Unless you really REALLY understood what you are doing there)
Closed. This question is opinion-based. It is not currently accepting answers.
Want to improve this question? Update the question so it can be answered with facts and citations by editing this post.
Closed 3 years ago.
Improve this question
I'd like to pack up presentation aspects of an application in a modular way; if I have a set of functionality in a separate JAR project, I'd like to keep UI elements related to that aspect separate from the core webapp code.
I think that tag libraries were the way to do this, so a lib could contain a bunch of classes implementing special interfaces and a descriptor. Then, the only footprint that the modular piece has would be one/more tags. Ideally, I'd like to avoid a runtime dependency on some specific modular piece being there... not sure how to achieve that!
Are tag libraries still the way to go? Or are there better options?
No, I wouldn't say so. The temptation to embed logic into those tags is too great. It locks too much stuff in the UI where it doesn't belong. How will that play when you need a mobile or tablet UI?
The only tag libraries you should need are JSTL.
JSF is a failure. I'd steer clear of that.
I would say that you're better off keeping your view layer as slim and simple as possible. Base it on HTML, CSS, and JavaScript. Put all the logic in services that are reusable and more likely to stick around as UIs come and go.
I use Velocity templates to generate HTML and map dynamic data from Spring models. I wouldn't use JSP or JSF unless forced to.
Since JSF is the latest view technology du jour in java world and it encourages creation of taglibs, I'd say they're here to stay for a while
Closed. This question is opinion-based. It is not currently accepting answers.
Want to improve this question? Update the question so it can be answered with facts and citations by editing this post.
Closed 7 years ago.
Improve this question
I know this question is subjective but I would really want to know what are the best j2ee web application auto code generators.
I googled and found out the Appfuse is one of them.
Spring ROO is another but it depends on spring i think.
Are there any other better tools?
Basically lot of time is spent on creating regular CRUD screens with the same mundane things for each screen.
So, I would want to reduce the time spent on such simple CRUD screens so that I can focus more on the core application logic.
We use Telosys (http://www.telosys.org/) to generate repetitive code like CRUD screens.
A set of templates are available for Spring MVC, JPA, AngularJS, etc.
We have customized some of them. It saves of lot of time.
The best solution I have seen so far is Grails. It generates groovy code, not java but you can interface painlessly with any java library/class. The convention over configuration features are amazing and one can put up a functioning web app in minutes. I suggest you see for yourself - just try the grails screencasts. They will get you up to speed in 15 minutes.The technologies used under the hood are best-of-breed : spring, hibernate, lucene, quartz, sitemesh etc.