Keyword Density Analysis using Java

Keyword Density Analysis Using Java

This code counts number of repeated words in a paragraph, count its number of appearance and calculates the density of the word.

Tested with NetBeans 8.0

JSP Page to get Input from User:

Servlet:

Show.jsp

 

Count Repeated Words in a Paragraph by Using Java

Count Repeated Words in a Paragraph by Using Java

Youtube: Video Tutorial

java.lang.OutOfMemoryError: PermGen space

java.lang.OutOfMemoryError: PermGen space

Error:

Solution 1:
1) Go to task manager –>Processes–>close java.exe and then restart glassfish server and run the application

Solution 2:
2) Open domain.xml inside glassfish folder
<jvm-options>-XX:MaxPermSize= 1024 (here change the size or 256 or 1024) this will increase the memory of glassfish and overcomes the error.

Sending Email Using Java

Sending Email Using Java

Here is the code to send email using Java. Here we are going to use gmail gateway to send emails.
Please follow these steps before you use this code:
1. Login your google account
2. In google search, search “Application-specific password”
3. Enter a label for your reference and select “generate password”
4. Copy that password and paste it in code at “//password here” line.

Tested in NetBeans 8.0

 

 

Saving Image in Folder and path in database using Java

Saving Image in Folder and path in database using Java

Here is the code to get the image from the user and store it in a folder and store the image path in Database.

JSP and Servlet
MySql Database
Tested with Netbeans 8.0

Database – create table with name and photourl as fields with datatype varchar().

JSP: (Upload Image)

Servlet: