Page tree
Skip to end of metadata
Go to start of metadata

Add new text to a JSP

Files:

Instructions:

  1. Open the relevant JSP and add a new <fmt:message> element where you want the new text to appear, making sure that the value of the key attribute is unique. For example:<fmt:message key="jsp.home.mynewkey" />
  2. Open Messages.properties and (for neatness) find the list of key values for the JSP you just changed. Add a new line corresponding to your new key.
    jsp.home.mynewkey = Text of my new key
  3. Note: Messages.properties contains pairs of "keys" and "values". For example: {{jsp.home.search1 = Search }}
  4. Generally speaking, the "key" usually refers to the location of the JSP on which this text resides (e.g. jsp.home.search1 is "search-related" text displayed in dspace-source/jsp/home.jsp)
  5. Perform the steps in Rebuild DSpace.

Notes:

  • You can, of course, simply add the text directly to the JSP, but you will find it easier to maintain text in your DSpace installation if it is all kept in Messages.properties.
  • Remember, when adding or modifying text in Messages.properties, be very careful that you have word-wrap turned off in your text editor!