1

After searching everywhere I don't find a solution for this question yet. I need to convert the following code snippet to java config.

<jsp-config>
 <jsp-property-group>
  <url-pattern>*.jsp</url-pattern>
  <page-encoding>UTF-8</page-encoding>
 </jsp-property-group>
</jsp-config>

Is that possible? Thank you

edit: It seems that should be a duplicated question. The question which refers is too old and maybe dead. I think starting a new question is much better although that the other question has a valid answer it does not solve my problem because it is understandable how to apply that solution.

Sotirios Delimanolis
  • 274,122
  • 60
  • 696
  • 724
Jj Jj
  • 11
  • 3
  • The answer of Do Nhu Vy is not related with what I need. Is about JSP but only for locating it, not for defining an encoding. So you recommend me to ask in that question? but if its older maybe no one will see it. I see its for Tomcat 8 but who answered question just paste that code and does not explain where must be defined that code, if a class must be extended or implemented... anything – Jj Jj Mar 08 '18 at 14:30
  • That question is an appropriate duplicate. In your edit, do you mean it's _**not** understandable_? What don't you understand? – Sotirios Delimanolis Mar 08 '18 at 17:08
  • I wrote a comment about why is not understandable but seems that someone delete it. Is not understandable because the answer of the original question shows a code in the middle of nowhere, I mean, its just a piece of code but no more info. Does not explain if some class must be overriden or must be implemented, anything. For me is a partial answer that requires more info like where this code must be defined among of an explanation of the code – Jj Jj Mar 12 '18 at 07:14
  • You'll note that the question itself shows where they are planning to put the configuration, in a `WebApplicationInitializer`. Note that explaining how to configure a servlet context is a whole question onto itself. And it's been asked and answered before. See [here](https://stackoverflow.com/questions/22315672/how-to-configure-spring-mvc-with-pure-java-based-configuration) for one example. – Sotirios Delimanolis Mar 12 '18 at 15:32
  • But the Spring documentation will serve you even better. See [here](https://docs.spring.io/spring/docs/current/spring-framework-reference/web.html#mvc-servlet). – Sotirios Delimanolis Mar 12 '18 at 15:33

0 Answers0