0

In my application, I have both html and JSP files. I need them both to pass through the controller. But it is not possible to use multiple internalViewResolvers in an application . Chaining is not possible in the case of internalViewResolvers since even if specify the "Order" values, this will be ignored and this resolver will always come up last.

There are two options:

1)To use a ResourceBundleViewResolver and have a properties file explicitly mapping each of the request. This involves the overhead of reading from properties file.

2)Rename the html files as ".jsp" (i.e) though they are simple HTML pages rename it as .jsp to fix this. - This will involve the overhead of "JSP" to servlet conversion . Though pages does not have dynamic content, marking them as "JSP" seems an overhead for me

Please advise which is going to be a better solution.

Raghav
  • 1,014
  • 2
  • 16
  • 34

2 Answers2

1

Actually, you don't need to run both through the controller if the HTML files are static. If that is the case, you can use the mvs:resources tag to optimize retrievel. See my post on this topic. In your case, you would just add *.html to the resources list.

Community
  • 1
  • 1
atrain
  • 9,139
  • 1
  • 36
  • 40
  • In my case, these html files are present in WEB_INF and needs to be pass through controller. So finally as Olemartin pointed out, I left the html files as JSP – Raghav Sep 22 '11 at 21:31
0

I wouldn't worry about the overhead. Neither of these options would take a lot of cpu or memory. I would go with the second option as then you won't have to keep the resourcebundle updated when adding new html files.

olemartin
  • 137
  • 1
  • 7