media-type

CSS media type: How to load CSS for mobile?

With this code: <link rel="stylesheet" type="text/css" href="media/css/mobile.css" media="handheld"/> <link rel="stylesheet" type="text/css" href="media/css/screen.css" media="screen"/> on my N78 the nokia's default browser and opera mini load screen.css instead of mobile.css. What am I missing? ...

Creating hypermedia links in a custom media-type

I am currently creating a set of custom media types for a RESTful api (e.g. application/vnd.mycompany.foo+xml) and I'm trying to identify the pros and cons of two different ways of exposing hypermedia links. If I first consider what other media types do probably the best place to start is HTML. Html allows me to create links such as: ...

How to create a hypermedia list with item sensitive links?

I have a representation that contains a list of items. This could easily contain several hundred items. <List> <ListItem>...</ListItem> <ListItem>...</ListItem> ... <ListItem>...</ListItem> <ListItem>...</ListItem> </List> For each item I want to provide a set of links that are available. Of the set of links, each item may o...

Request Accept media type in RESTlet 2

How can I identify the resource media type in RESTlet2, I tried following in my class extended from ServerResource @Get public Object onGET(){ System.out.println("================="); System.out.println(this.getRequestEntity().getMediaType()); ... It prints a null when I do any request. I want to get the list of all Accept medi...

determining whether a MIME type is binary or text-based

Is there a library which allows determining whether a given content type is binary or text-based? Obviously text/* is always textual, but for things like application/json, image/svg+xml or even application/x-latex it's rather tricky without inspecting the actual data. ...