Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
B
broken-petclinic
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Container Registry
Model registry
Operate
Environments
Monitor
Incidents
Service Desk
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
s61200
broken-petclinic
Commits
4ccf1eaa
Commit
4ccf1eaa
authored
12 years ago
by
Mic
Browse files
Options
Downloads
Patches
Plain Diff
did some clean up for ViewResolvers configuration
parent
c5ca72e8
No related branches found
No related tags found
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
src/main/webapp/WEB-INF/mvc-core-config.xml
+2
-2
2 additions, 2 deletions
src/main/webapp/WEB-INF/mvc-core-config.xml
src/main/webapp/WEB-INF/mvc-view-config.xml
+21
-31
21 additions, 31 deletions
src/main/webapp/WEB-INF/mvc-view-config.xml
with
23 additions
and
33 deletions
src/main/webapp/WEB-INF/mvc-core-config.xml
+
2
−
2
View file @
4ccf1eaa
...
@@ -23,7 +23,7 @@
...
@@ -23,7 +23,7 @@
(see header.jsp for more details) -->
(see header.jsp for more details) -->
<mvc:resources
mapping=
"/resources/**"
location=
"/resources/"
/>
<mvc:resources
mapping=
"/resources/**"
location=
"/resources/"
/>
<!-- uses WebJars so Javascript and CSS libs can be declared as Maven dependencies (
we're using it for Bootstrap
) -->
<!-- uses WebJars so Javascript and CSS libs can be declared as Maven dependencies (
Bootstrap, jQuery...
) -->
<mvc:resources
mapping=
"/webjars/**"
location=
"classpath:/META-INF/resources/webjars/"
/>
<mvc:resources
mapping=
"/webjars/**"
location=
"classpath:/META-INF/resources/webjars/"
/>
<mvc:view-controller
path=
"/"
view-name=
"welcome"
/>
<mvc:view-controller
path=
"/"
view-name=
"welcome"
/>
...
@@ -51,7 +51,7 @@
...
@@ -51,7 +51,7 @@
<bean
class=
"org.springframework.web.servlet.handler.SimpleMappingExceptionResolver"
>
<bean
class=
"org.springframework.web.servlet.handler.SimpleMappingExceptionResolver"
>
<!-- view name resolved using bean of type InternalResourceViewResolver (declared in mvc-view-config.xml) -->
<!-- view name resolved using bean of type InternalResourceViewResolver (declared in mvc-view-config.xml) -->
<property
name=
"defaultErrorView"
value=
"exception"
/>
<!-- results into 'WEB-INF/jsp/exception.jsp' -->
<property
name=
"defaultErrorView"
value=
"exception"
/>
<!-- results into 'WEB-INF/jsp/exception.jsp' -->
<property
name=
"warnLogCategory"
value=
"warn"
/>
<property
name=
"warnLogCategory"
value=
"warn"
/>
<!-- needed otherwise exceptions won't be logged anywhere -->
</bean>
</bean>
</beans>
</beans>
This diff is collapsed.
Click to expand it.
src/main/webapp/WEB-INF/mvc-view-config.xml
+
21
−
31
View file @
4ccf1eaa
...
@@ -12,52 +12,42 @@
...
@@ -12,52 +12,42 @@
<!--
<!--
- This view resolver delegates to the InternalResourceViewResolver and BeanNameViewResolver,
- The ContentNegotiatingViewResolver delegates to the InternalResourceViewResolver and BeanNameViewResolver,
- and uses the requested media type to pick a matching view. When the media type is 'text/html',
- and uses the requested media type (determined by the path extension) to pick a matching view.
- it will delegate to the InternalResourceViewResolver's JstlView, otherwise to the
- When the media type is 'text/html', it will delegate to the InternalResourceViewResolver's JstlView,
- BeanNameViewResolver. Note the use of the expression language to refer to the contentType
- otherwise to the BeanNameViewResolver.
- property of the vets view bean, setting it to 'application/vnd.springsource.samples.petclinic+xml'.
-->
-->
<bean
class=
"org.springframework.web.servlet.view.ContentNegotiatingViewResolver"
>
<bean
class=
"org.springframework.web.servlet.view.ContentNegotiatingViewResolver"
>
<property
name=
"contentNegotiationManager"
ref=
"cnManager"
/>
<property
name=
"contentNegotiationManager"
ref=
"cnManager"
/>
<property
name=
"order"
value=
"0"
/>
</bean>
</bean>
<!-- Simple strategy: only path extension is taken into account -->
<bean
id=
"cnManager"
class=
"org.springframework.web.accept.ContentNegotiationManagerFactoryBean"
>
<bean
id=
"cnManager"
class=
"org.springframework.web.accept.ContentNegotiationManagerFactoryBean"
>
<property
name=
"mediaTypes"
>
<property
name=
"favorPathExtension"
value=
"true"
/>
<value>
<property
name=
"ignoreAcceptHeader"
value=
"true"
/>
xml=application/vnd.springsource.samples.petclinic+xml
atom=#{visitList.contentType}
</value>
</property>
</bean>
</bean>
<!--
<!-- Default viewClass: JSTL view (JSP with html output) -->
- The BeanNameViewResolver is used to pick up the visits view name (below).
<bean
class=
"org.springframework.web.servlet.view.InternalResourceViewResolver"
>
- It has the order property set to 2, which means that this will
<!-- Example: a logical view name of 'vets' is mapped to '/WEB-INF/jsp/vets.jsp' -->
- be the first view resolver to be used after the delegating content
<property
name=
"prefix"
value=
"/WEB-INF/jsp/"
/>
- negotiating view resolver.
<property
name=
"suffix"
value=
".jsp"
/>
-->
</bean>
<bean
class=
"org.springframework.web.servlet.view.BeanNameViewResolver"
p:order=
"1"
/>
<!--
- This bean configures the 'prefix' and 'suffix' properties of
- InternalResourceViewResolver, which resolves logical view names
- returned by Controllers. For example, a logical view name of "vets"
- will be mapped to "/WEB-INF/jsp/vets.jsp".
-->
<bean
class=
"org.springframework.web.servlet.view.InternalResourceViewResolver"
p:prefix=
"/WEB-INF/jsp/"
p:suffix=
".jsp"
p:order=
"2"
/>
<!-- - The AtomView rendering a Atom feed of the visits -->
<!-- Used here for 'xml' and 'atom' views -->
<bean
class=
"org.springframework.web.servlet.view.BeanNameViewResolver"
/>
<!-- Renders an Atom feed of the visits. Used by the BeanNameViewResolver -->
<bean
id=
"visitList"
class=
"org.springframework.samples.petclinic.web.VisitsAtomView"
/>
<bean
id=
"visitList"
class=
"org.springframework.samples.petclinic.web.VisitsAtomView"
/>
<!-- Renders an XML view. Used by the BeanNameViewResolver -->
<bean
id=
"vets/vetList"
class=
"org.springframework.web.servlet.view.xml.MarshallingView"
>
<bean
id=
"vets/vetList"
class=
"org.springframework.web.servlet.view.xml.MarshallingView"
>
<property
name=
"marshaller"
ref=
"marshaller"
/>
<property
name=
"marshaller"
ref=
"marshaller"
/>
</bean>
</bean>
<oxm:jaxb2-marshaller
id=
"marshaller"
>
<oxm:jaxb2-marshaller
id=
"marshaller"
>
<oxm:class-to-be-bound
name=
"org.springframework.samples.petclinic.model.Vets"
/>
<!-- Object-XML mapping declared using annotations inside 'Vets' -->
<oxm:class-to-be-bound
name=
"org.springframework.samples.petclinic.model.Vets"
/>
</oxm:jaxb2-marshaller>
</oxm:jaxb2-marshaller>
</beans>
</beans>
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment