|
|
|
Freemarker
|
|||
|---|---|---|---|
|
#18+
Пробую использовать Freemarker Выдается такая ошибка javax.servlet.ServletException: Could not resolve view with name 'hello' in servlet with name 'TrainingCenterServlet' pom.xml Код: xml 1. 2. 3. 4. 5. web.xml Код: xml 1. 2. 3. 4. 5. 6. 7. 8. 9. 10. 11. 12. 13. 14. 15. 16. 17. 18. 19. 20. 21. 22. 23. 24. 25. 26. 27. spring-config.xml Код: xml 1. 2. 3. 4. 5. 6. 7. 8. 9. 10. 11. 12. 13. 14. 15. 16. 17. 18. 19. 20. 21. 22. 23. 24. 25. 26. 27. 28. 29. 30. 31. hello.ftl Код: xml 1. 2. 3. 4. 5. 6. 7. 8. 9. 10. 11. 12. TrainingCenter.java Код: java 1. 2. 3. 4. 5. 6. 7. 8. 9. 10. 11. 12. 13. 14. 15. 16. 17. 18. 19. 20. 21. 22. 23. 24. 25. 26. 27. 28. 29. 30. xml файлы лежат в WEB-INF ftl в webapp. ... |
|||
|
:
Нравится:
Не нравится:
|
|||
| 25.04.2015, 19:10 |
|
||
|
Freemarker
|
|||
|---|---|---|---|
|
#18+
Подозрение такое. Джавадок по FreeMarkerViewResolver говорит: FreeMarkerViewResolverFreeMarkerViewResolver will check for the existence of the specified template resources and only return a non-null View object if the template was actually found. Шаблон лежит в /, а в конфиге Freemarker сказано искать начиная с /WEB-INF FreeMarkerViewResolver спрашивает у Freemarker шаблон /hello.ftl, тот ничего в /WEB-INF не находит, и FreeMarkerViewResolver сообщает, что такого View нет. ... |
|||
|
:
Нравится:
Не нравится:
|
|||
| 25.04.2015, 21:13 |
|
||
|
Freemarker
|
|||
|---|---|---|---|
|
#18+
Alexander A. SakПодозрение такое. Джавадок по FreeMarkerViewResolver говорит: FreeMarkerViewResolverFreeMarkerViewResolver will check for the existence of the specified template resources and only return a non-null View object if the template was actually found. Шаблон лежит в /, а в конфиге Freemarker сказано искать начиная с /WEB-INF FreeMarkerViewResolver спрашивает у Freemarker шаблон /hello.ftl, тот ничего в /WEB-INF не находит, и FreeMarkerViewResolver сообщает, что такого View нет. Исправил, получилось.Спасибо Еще вопрос, а можно ли использовать ftl и jsp ? как это прописать? ... |
|||
|
:
Нравится:
Не нравится:
|
|||
| 25.04.2015, 22:19 |
|
||
|
Freemarker
|
|||
|---|---|---|---|
|
#18+
goldenhawkЕще вопрос, а можно ли использовать ftl и jsp ? как это прописать? Использовать можно, только по вопросу не понятно что именно имеется в виду. Если требуется, чтобы при отсутствии шаблона FTL делался поиск JSP, то вроде достаточно добавить в контекст еще один ViewResolver: http://docs.spring.io/spring/docs/3.2.x/spring-framework-reference/html/mvc.html#mvc-viewresolver-chaining 17.5.2 Chaining ViewResolvers Spring supports multiple view resolvers. Thus you can chain resolvers and, for example, override specific views in certain circumstances. You chain view resolvers by adding more than one resolver to your application context and, if necessary, by setting the order property to specify ordering ... |
|||
|
:
Нравится:
Не нравится:
|
|||
| 26.04.2015, 10:22 |
|
||
|
|

start [/forum/topic.php?fid=59&fpage=132&tid=2125500]: |
0ms |
get settings: |
9ms |
get forum list: |
23ms |
check forum access: |
4ms |
check topic access: |
4ms |
track hit: |
50ms |
get topic data: |
9ms |
get forum data: |
2ms |
get page messages: |
32ms |
get tp. blocked users: |
1ms |
| others: | 217ms |
| total: | 351ms |

| 0 / 0 |
