Spring MVC Carousel - java

How to make images slider (carousel) in Java Spring MVC.
I have admin panel which upload the images to local drive.
I would like to display images from local drive to JSP page in carousel.
Please guide.
Also I tried one example from the link https://blog.e-zest.com/dynamic-carousel-built-using-javascript/ but I am getting javascript error.
Thanks,
Bhavin

First you need to be able to serve your files to web browser. You can serve files from local drive using tomcat or web server (nginx, Apache httpd etc) built-in features without writing Java code or write a Spring controller to read files form drive and serve them if you need custom logic.
Then you could use one of javascript carousel plugins like Slick or another - there is a great choice of those.
Add needed scripts and css to your page and follow selected plugin instructions to create needed HTML with your JSP page.

Related

How to integrate java apis with HTML pages

I have a jar file which i want to integrate with web page and run on web browser (my be chrome). So what i want to do is calling a java API which will give me some data using which i want to populate web page. so the java code will run in the background. Now user can select any one of the option from web page and i want to send user input through java API.
Only thing i can think of currently is through java applet. Is there any other way to do this. May be something similar to applet already available in the market.

How to build Angular6 project while having html,css and js files

I am developing a website using angular6 and spring boot with microservice architecture.
I have got the UI from designer team in the form of HTML, CSS, and JS file, whose structure is attached here HTML and CSS files
Also, I had created a angular6 project named DIS, whose structure is attached here Angular6 project
What will be the best way to start with angular 6?
How to include these files in angular6 project considering microservices architecture?
If i understood your question correctly.Yes you can do that.
Step 1: You need to create the Necessary components, Modules needed to build your website.
Step 2: Replace the components with the necessary HTML file and CSS file. As you generate a component with CLI you should have those 2 files just replace them.
When you have global CSS files that can be shared among other files as well. You can configure using Angular CLI.
Regards to microservices architecture, that does not have anything to do with your front end applicaiton, its totally on the server side. But you can consider while creating the components based on the services you have.
ng new ng6-proj --style=scss --routing
Just make changes in the main style.scss that will apply globally.
Images you can keep it anywhere, you just need to use it by providing its path

Communication between frontend (jsp webpage on localhost) and backend (java program) using eclipse

I am new to front end developing. I have so far a back-end program written in java with Eclipse that does all I want, saves the output in an object and prints it in the console (for my convenience).
My goal is to display this output information dynamically (meaning that the backend part of the program might update and send new output) in a webpage on a local server.
Hence I have "transformed" or "added" a Dynamical webpage to my Eclipse project using "Project Facets" in Eclipse Project Properties, and created an index.jsp file hosted on a tomcat server (See picture of the File organisation).
Ultimately, I want to have my index.jsp file open in my browser and when my backend program (which I assume I have to compile in an executable jar) detects changes , display those changes in the webpage. Also, I have a button on my webpage for which I would like to send information back to my backend program when it is clicked.
Should I use POST request in my backend with the URL of the index.jsp (although I don t want to display the information in a form, just regular text and images)?
or create a Javabean class in the webcontent/WEB-INF/ (if I can access and modify it dynamically from my backend) and then use that to get and set data from the jsp page?
or am I obliged to use something like Spring ?
I ve heard I should seperate backend and front end, but I don t really understand how they communicate dynamically !
Thank you for your help !
Seeing your project structure I believe you want to build a simple Java Web, you don't need to separate your front-end and back-end unless you want to build something complex.
I'm not quite sure about your experience with Java Web, but if this is your first time I suggest to learn more about Servlet because this is the fundamental in building Java Web project. After knowing how Java handle Http Request is up to you to build pure Java Web project, or using something like Spring MVC even if you want to build a separate front-end that communicate using REST API towards the back-end.

Run an event referring to an external web page ..?

I ask you how to run an event related to an external web page.
In this case the external web page is the following: https://tools.pdf24.org/en/webpage-to-pdf
The web page converts the URL of web pages to pdf.
I want to programmatically execute the generation of PDF, considering that I have a list of web page that I need to be in PDF.
I ask if you have a tool in PHP, JQUERY or JAVA.
Where you can execute the generation of PDF by means of the external web page.
Thanks
At the time of this writing there are a couple of options, wkhtmltopdf and jsPDF.
wkhtmltopdf is a commandline line tool that uses the webkit engine to create PDFs from an HTML source. There are also multiple server side libraries and wrappers for this that you can use.
(link at time of writing) https://wkhtmltopdf.org/
jsPDF is a client side library that accomplishes what you're asking.
(link at time of writing) https://github.com/MrRio/jsPDF

How to download an html file in a BlackBerry application

I need to scrape information from a web page and put it into my application, but I can't figure out how to download the file into my application in the first place. Anyone have any ideas?
You can use my simple page scraping code. You'll also want to use Versatile Monkey's networking helper class to open the HTTP connection using the best path on a BlackBerry.

Categories

Resources