Skip to main content
summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--plugins/org.eclipse.osee.jaxrs.server/src/org/eclipse/osee/jaxrs/server/internal/mvc/ViewModelWriter.java14
-rw-r--r--plugins/org.eclipse.osee.template.engine/src/org/eclipse/osee/template/engine/internal/PageFactoryViewResolver.java6
2 files changed, 17 insertions, 3 deletions
diff --git a/plugins/org.eclipse.osee.jaxrs.server/src/org/eclipse/osee/jaxrs/server/internal/mvc/ViewModelWriter.java b/plugins/org.eclipse.osee.jaxrs.server/src/org/eclipse/osee/jaxrs/server/internal/mvc/ViewModelWriter.java
index 72b4dc43dfc..b5511876761 100644
--- a/plugins/org.eclipse.osee.jaxrs.server/src/org/eclipse/osee/jaxrs/server/internal/mvc/ViewModelWriter.java
+++ b/plugins/org.eclipse.osee.jaxrs.server/src/org/eclipse/osee/jaxrs/server/internal/mvc/ViewModelWriter.java
@@ -136,16 +136,26 @@ public class ViewModelWriter implements MessageBodyWriter<ViewModel> {
}
private static List<MediaType> getMediaTypesProduced(ResourceInfo resourceInfo) {
- List<MediaType> produces = new ArrayList<MediaType>();
+ ArrayList<MediaType> produces = new ArrayList<MediaType>();
+ boolean hasText = false;
Method method = resourceInfo.getResourceMethod();
List<Produces> annotations = getAnnotations(method, Produces.class);
for (Produces annotation : annotations) {
String[] mediaTypes = annotation.value();
for (String mediaType : mediaTypes) {
- produces.add(MediaType.valueOf(mediaType));
+ MediaType toAdd = MediaType.valueOf(mediaType);
+ if (MediaType.TEXT_HTML_TYPE.equals(toAdd)) {
+ hasText = true;
+ } else {
+ produces.add(toAdd);
+ }
}
}
+
+ if (hasText) {
+ produces.add(0, MediaType.TEXT_HTML_TYPE);
+ }
if (produces.isEmpty()) {
produces.add(MediaType.WILDCARD_TYPE);
}
diff --git a/plugins/org.eclipse.osee.template.engine/src/org/eclipse/osee/template/engine/internal/PageFactoryViewResolver.java b/plugins/org.eclipse.osee.template.engine/src/org/eclipse/osee/template/engine/internal/PageFactoryViewResolver.java
index 70c01cf2d31..012732bd997 100644
--- a/plugins/org.eclipse.osee.template.engine/src/org/eclipse/osee/template/engine/internal/PageFactoryViewResolver.java
+++ b/plugins/org.eclipse.osee.template.engine/src/org/eclipse/osee/template/engine/internal/PageFactoryViewResolver.java
@@ -37,7 +37,11 @@ public class PageFactoryViewResolver extends AbstractViewResolver<ResourceToken>
@Override
public ResourceToken resolve(String viewId, MediaType mediaType) {
- return registry.resolveTemplate(viewId, mediaType);
+ ResourceToken toReturn = null;
+ if (MediaType.TEXT_HTML_TYPE.equals(mediaType) || MediaType.WILDCARD_TYPE.equals(mediaType)) {
+ toReturn = registry.resolveTemplate(viewId, mediaType);
+ }
+ return toReturn;
}
@Override

Back to the top