3

I have a Spring/Glassfish project created using a NetBeans wizard at the start of the year (so I don't remember the exact settings used to create it).

The strange thing though is that there is no glassfish-web.xml file inside the project whereas a different project created at the same time does have one.

Why would a project not have a glassfish-web.xml file?

I've been investigating a character encoding issue and some responses suggest adding to glassfish-web.xml:

 <sun-web-app>
      <parameter-encoding default-charset="UTF-8" />
 </sun-web-app>

However I can't do that as I don't have a glassfish-web.xml!

Is it possible to add one? If so what do I need to do in order to make sure it is read?

Tim B
  • 40,716
  • 16
  • 83
  • 128

1 Answers1

4

If the file is included after project creation depends on the archetype (means the project template you have chosen) which is used. Some archetypes already contain a glassfish-web.xml, most of them don't.

You can easily create one by right-clicking on the folder WEB-INF, then choose New and GlassFish Descriptor. If this option is not available you may have to add the JSF facet to your project (right-click the project and add JSF in the frameworks tab).

You can also create the file manually, just create a new xml file in the WEB-INF folder, give the appropriate name and paste the desired content into the file.

See also:

Community
  • 1
  • 1
unwichtich
  • 13,712
  • 4
  • 53
  • 66