GithubHelp home page GithubHelp logo

sergio11 / struts2-hibernate Goto Github PK

View Code? Open in Web Editor NEW
1.0 3.0 0.0 143 KB

This project demonstrates building a web application with Struts2, Apache Tika, Hibernate, and Wildfly 10. ๐Ÿš€ Users can upload PDF files, extract text content using Apache Tika, and store metadata in a database using Hibernate. ๐Ÿ”’ Additionally, the project provides instructions for setting up a JDBC Realm on Wildfly 10 for enhanced security.

License: Apache License 2.0

Java 99.63% CSS 0.37%
hibernate hibernate-jpa hibernate-search jdbc structs2 tika wildfly

struts2-hibernate's Introduction

Building a PDF File Indexing Project with Struts2, Apache Tika, Hibernate, and Wildfly 10 ๐Ÿ“„๐Ÿ”

This project aims to demonstrate the construction of a web application for indexing PDF files using Struts2, Apache Tika, Hibernate, and Wildfly 10.

Overview โ„น๏ธ

This web application provides functionalities for indexing PDF files, including:

  • Uploading PDF files for indexing
  • Extracting text content from PDF files using Apache Tika
  • Storing metadata and extracted text content in a database using Hibernate
  • Searching indexed PDF files

The project utilizes the following technologies:

  • Struts2: A web application framework for developing Java EE web applications.
  • Apache Tika: A content analysis toolkit capable of extracting text and metadata from various document formats, including PDF.
  • Hibernate: An object-relational mapping (ORM) library for the Java language.
  • Wildfly 10: A lightweight, flexible, and modular application server for Java EE applications.

Features ๐Ÿš€

  • Struts2 Actions: Actions for handling user requests and interacting with the backend services.
  • Apache Tika Integration: Integration of Apache Tika for extracting text content and metadata from PDF files.
  • Hibernate Entities: Entities representing the data model for storing PDF file metadata and text content.
  • User Interface: Basic user interface for uploading PDF files and searching indexed PDF files.

Setting Up a JDBC Realm on Wildfly 10 ๐Ÿ”’

To enhance security and manage authentication and authorization, you can set up a JDBC Realm on Wildfly 10. Follow the steps outlined below:

  1. Create Security Domain:

    We create a security domain named booksRealm, configuring it to use a default cache type for enhanced performance.

  2. Configure Authentication:

    Within the booksRealm security domain, we configure the authentication method as classic, indicating traditional login-based authentication. Two login modules are defined:

    • Database: This module handles authentication by querying a database. It requires specifying the JNDI name of the datasource (java:/jdbc/booksDS), along with SQL queries to retrieve user credentials and roles. Password hashing is performed using the MD5 algorithm with BASE64 encoding.

    • RoleMapping: This module maps roles retrieved from the database to application roles defined in a properties file. The path to the properties file containing role mappings (booksRealm.properties) is provided, along with an option to replace existing roles.

Contributing ๐Ÿค

Contributions to this project are welcome! If you have ideas for improvements, new features, or bug fixes, feel free to open an issue or submit a pull request.

License ๐Ÿ“

This project is licensed under the MIT License.

Visitors Count

Please Share & Star the repository to keep me motivated.

struts2-hibernate's People

Contributors

sergio11 avatar

Stargazers

 avatar

Watchers

 avatar  avatar  avatar

struts2-hibernate's Issues

Create FileStorageEntity for upload file Process

-> Create FileStorageEntity for save any upload file information.
-> Use Apache Commons IO for get raw data from file and then save to content on FileStorageEntity

Example as this:

byte[] bytes = IOUtils.toByteArray( item.openStream() );

-> Create Subsclass of FileStorageEntity for index pdf content with TikaBridge.
-> Implementing struts2 action for show files

References:

EJB3.x JPA: How To Store An Image Or A Binary File As BLOB In Database

Display a Pdf using Struts2 in a Jsp

How can I store BLOB in DB from Servlet using JPA

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.