Created Netbeans project does not have glassfish-web.xml

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

It is strange, however, that there is no file inside the project glassfish-web.xml

, whereas another project created at the same time has one.

Why doesn't the project have a file glassfish-web.xml

?

I am researching a character encoding problem and some answers suggest adding to glassfish-web.xml

:

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

      

However, I cannot do this as I have not glassfish-web.xml

!

Can I add one? If so, what do I need to do to make sure it reads?

+3


source to share


1 answer


Whether the file is included after project creation depends on the archetype used (for example, the project template you choose). Some archetypes already contain glassfish-web.xml

, most of them don't.

You can create it easily by right clicking on the folder WEB-INF

then select New

and GlassFish Descriptor

. If this option is not available, you may have to add the JSF facet to your project (right click on the project and add JSF in the frameworks tab).

You can also create the file manually, just create a new xml file in the folder WEB-INF

, specify the appropriate name and insert the desired content into the file.



See also:

+4


source







All Articles