Join the social network of Tech Nerds, increase skill rank, get work, manage projects...
  • How to read properties from property file in jsp?

    • 0
    • 0
    • 0
    • 0
    • 0
    • 0
    • 0
    • 0
    • 13.9k
    Comment on it

    Create a property file in the package with extension '.properties' and use those properties defined in the file in jsp by importing the resource bundle package in the jsp.




     <%@ page import = "java.util.ResourceBundle" %>
     <% ResourceBundle resource = ResourceBundle.getBundle("config");
        String name=resource.getString("name");
        String email=resource.getString("email");
        String phone=resource.getString("phone");
        Name:  <input type="text" id="name" value="<%=name %>">
        Email: <input type="text" id="email" value="<%=email %>">
        Phone: <input type="text" id="phone" value="<%=phone %>">

 0 Comment(s)

Sign In

Sign up using

Forgot Password
Fill out the form below and instructions to reset your password will be emailed to you:
Reset Password
Fill out the form below and reset your password: