Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
S
spring-petclinic-microservices
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
Package registry
Container Registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
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
Sebastien Briot
spring-petclinic-microservices
Commits
05c1110d
"mysql-backup" did not exist on "392017ff584884ca7e931fba94dc2883971f88e6"
Commit
05c1110d
authored
12 years ago
by
Mic
Browse files
Options
Downloads
Patches
Plain Diff
fixed content negotiation configuration
parent
bfa4f85a
No related branches found
No related tags found
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
src/main/webapp/WEB-INF/petclinic-servlet.xml
+38
-23
38 additions, 23 deletions
src/main/webapp/WEB-INF/petclinic-servlet.xml
with
38 additions
and
23 deletions
src/main/webapp/WEB-INF/petclinic-servlet.xml
+
38
−
23
View file @
05c1110d
...
...
@@ -16,8 +16,7 @@
<context:component-scan
base-package=
"org.springframework.samples.petclinic.web"
/>
<mvc:annotation-driven
/>
<!-- <mvc:annotation-driven content-negotiation-manager="contentNegotiationManager" /> -->
<mvc:annotation-driven
/>
<!-- all resources inside folder src/main/webapp/resources are mapped so they can be refered to inside JSP files
(see header.jsp for more details) -->
...
...
@@ -27,6 +26,38 @@
<mvc:resources
mapping=
"/webjars/**"
location=
"classpath:/META-INF/resources/webjars/"
/>
<!--
- This view resolver delegates to the InternalResourceViewResolver and BeanNameViewResolver,
- and uses the requested media type to pick a matching view. When the media type is 'text/html',
- it will delegate to the InternalResourceViewResolver's JstlView, otherwise to the
- BeanNameViewResolver. Note the use of the expression language to refer to the contentType
- property of the vets view bean, setting it to 'application/vnd.springsource.samples.petclinic+xml'.
-->
<bean
class=
"org.springframework.web.servlet.view.ContentNegotiatingViewResolver"
>
<property
name=
"contentNegotiationManager"
>
<bean
class=
"org.springframework.web.accept.ContentNegotiationManager"
>
<constructor-arg>
<bean
class=
"org.springframework.web.accept.PathExtensionContentNegotiationStrategy"
>
<constructor-arg>
<map>
<entry
key=
"xml"
value=
"#{vets.contentType}"
/>
<entry
key=
"atom"
value=
"#{visits.contentType}"
/>
</map>
</constructor-arg>
</bean>
</constructor-arg>
</bean>
</property>
<property
name=
"order"
value=
"0"
/>
</bean>
<!--
- The BeanNameViewResolver is used to pick up the visits view name (below).
- It has the order property set to 2, which means that this will
- be the first view resolver to be used after the delegating content
- negotiating view resolver.
-->
<bean
class=
"org.springframework.web.servlet.view.BeanNameViewResolver"
p:order=
"1"
/>
<!--
- This bean configures the 'prefix' and 'suffix' properties of
...
...
@@ -35,7 +66,7 @@
- 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:suffix=
".jsp"
p:order=
"2"
/>
<!--
- Message source for this context, loaded from localized "messages_xx" files.
...
...
@@ -82,31 +113,15 @@
<!-- <bean id="contentNegotiationManager" class="org.springframework.web.accept.ContentNegotiationManagerFactoryBean">
<property name="favorPathExtension" value="false" />
<property name="favorParameter" value="true" />
<property name="mediaTypes">
<value>
atom=application/atom+xml
html=text/html
xml=application/xml
</value>
</property>
</bean> -->
<!--
- The BeanNameViewResolver is used to pick up the visits view name (below).
- It has the order property set to 1, which means that this will
- be the first view resolver to be used after the delegating content
- negotiating view resolver.
-->
<!-- <bean class="org.springframework.web.servlet.view.BeanNameViewResolver" /> -->
<!-- - The AtomView rendering a Atom feed of the visits -->
<!--
<bean id="visits" class="org.springframework.samples.petclinic.web.VisitsAtomView"/>
<bean
id=
"visits"
class=
"org.springframework.samples.petclinic.web.VisitsAtomView"
/>
<bean
id=
"vets"
class=
"org.springframework.web.servlet.view.xml.MarshallingView"
>
<property
name=
"contentType"
value=
"application/vnd.springsource.samples.petclinic+xml"
/>
...
...
@@ -115,7 +130,7 @@
<oxm:jaxb2-marshaller
id=
"marshaller"
>
<oxm:class-to-be-bound
name=
"org.springframework.samples.petclinic.Vets"
/>
</oxm:jaxb2-marshaller>
-->
</oxm:jaxb2-marshaller>
...
...
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