Skip to content

Tag: html

Get n-th child Element with Jsoup

For example a web site has a code like this: and I want to get the “second” div text with “Jsoup” and it has no attribute or class. Answer There are few ways to to it. select returns Elements instance which extends ArrayList<Element> so you can select all child divs and pick one …

JSP can’t display Russian characters

I have a JSP file that contains paragraphs with Russian text. However, no matter what I do I can’t get a browser to display that text – instead all I get is hieroglyphs. The same text but in a simple HTML file without any headers or declarations works fine: But the moment I save that file as JSP a…

>> converted to �

One of the application user has reported that they are seeing � instartd of >> on their home and other pages. There are about 100 users and only one user has this issue. The user is using IE11. what may be the cause of this issue. Answer You should have this on top of your jsp files: If you have

Serving HTML pages in a Spring Boot application

I have a Spring Boot Application. I am trying to pass a variable to a HTML page but unfortunately I cannot seem to do it, on application start nothing is rendered except the static text: “WORLD”. My controller is as below: And my index.html: I was looking for an answer and I found these articles: …

JSP doesn’t see CSS and JS files from resources folder

I have some problem with my css and js import in my web application. I am using Servlets/JSP/CSS/JS. I am sorry for this question, i saw many questions and answers for this theme and situation but nothing helped me. I am trying to add css and js files like this: But something happends and all of my css and js

how to send a html email with attached file using JavaMail

The following Java code is used to attach a file to a html email and send it. I want to send attachment with this html email. Any suggestions would be appreciated. This brings me just only the attachment . But i want to send html email with this attachment . Answer Creating a mail with an HTML body and an