Static vs. Dynamic content stream differences.

classic Classic list List threaded Threaded
3 messages Options
Reply | Threaded
Open this post in threaded view
|

Static vs. Dynamic content stream differences.

Alex Karasulu-4
I have a servlet which reads static content sitting on disk and pumps it
out in the response stream.  This servlet reads a jar file (a J2ME
application) from disk and returns it's bytes as a
application/java-archive.  The same jar file can be accessed directly
rather than going through the servlet.  Here are the two URLs to access
this jar file:

(1) http://karasulu.homeip.net/activation/test/
(2) http://karasulu.homeip.net/activation/HausKeys.jar

I made sure the response headers and content type of the servlet (1)
matches that of the server's response to the direct static file access
in (2).  Now here's the interesting problem:

The two resultant streams are different somehow and I cannot figure out
how.  I know they are different because my Sony Ericsson T610 can load
(2) just fine.  However when it tries to load from (1) the request makes
it to the servlet and initiates the return of the response but the
response causes the phone to give me the following error:

"Your client is not allowed to access the requested object"

I would like both these URLs to have the same effect hence be exactly
the same through the eyes of this phone's WAP browser.  Something in the
responses is different.  Even though the response headers are all the
same I cannot get these two URLs to behave the same way.  Here are the
headers for both (obviously with different dates):

statusCode: 200
statusLine: HTTP/1.1 200 OK
statusText: OK
responseCharSet: ISO-8859-1
responseFooters:
responseHeaders:
    Date: Fri, 02 Dec 2005 19:13:24 GMT
    Server: Jetty/5.1.5 (Linux/2.6.14-1.1637_FC4 i386 java/1.5.0_05
    Content-Type: application/java-archive
    Content-Length: 33603
    Accept-Ranges: bytes
    Last-Modified: Fri, 02 Dec 2005 19:13:24 GMT

Ahh and from the Server header you can see that I'm using Jetty 5.1.5 on
SUN JDK 1.5.0_05.  Any clue as to what is different in these responses?  
I'm totally perplexed.

Thanks much,
Alex



-------------------------------------------------------
This SF.net email is sponsored by: Splunk Inc. Do you grep through log files
for problems?  Stop!  Download the new AJAX search engine that makes
searching your log files as easy as surfing the  web.  DOWNLOAD SPLUNK!
http://ads.osdn.com/?ad_id=7637&alloc_id=16865&op=click
_______________________________________________
Jetty-support mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/jetty-support
Reply | Threaded
Open this post in threaded view
|

Re: Static vs. Dynamic content stream differences.

Greg Wilkins-5

Alex,

i tried this with telnet and got:


[514] telnet karasulu.homeip.net 80
Trying 65.80.200.112...
Connected to karasulu.homeip.net.
Escape character is '^]'.
GET /activation/test/ HTTP/1.0

HTTP/1.1 200 OK
Date: Mon, 05 Dec 2005 13:12:14 GMT
Server: Jetty/5.1.5 (Linux/2.6.14-1.1637_FC4 i386 java/1.5.0_05
Content-Type: text/text;charset=ISO-8859-1
Content-Length: 50
Connection: close

No such safehaus account with activation key: testConnection closed by foreign host.


for both requests???

so I can't really tell??

For the servlet, try mapping it to a URL that ends with .jar just to make
sure the phone is not being dumb and doing it's own extension to mime-type mapping.

regards





Alex Karasulu wrote:

> I have a servlet which reads static content sitting on disk and pumps it
> out in the response stream.  This servlet reads a jar file (a J2ME
> application) from disk and returns it's bytes as a
> application/java-archive.  The same jar file can be accessed directly
> rather than going through the servlet.  Here are the two URLs to access
> this jar file:
>
> (1) http://karasulu.homeip.net/activation/test/
> (2) http://karasulu.homeip.net/activation/HausKeys.jar
>
> I made sure the response headers and content type of the servlet (1)
> matches that of the server's response to the direct static file access
> in (2).  Now here's the interesting problem:
>
> The two resultant streams are different somehow and I cannot figure out
> how.  I know they are different because my Sony Ericsson T610 can load
> (2) just fine.  However when it tries to load from (1) the request makes
> it to the servlet and initiates the return of the response but the
> response causes the phone to give me the following error:
>
> "Your client is not allowed to access the requested object"
>
> I would like both these URLs to have the same effect hence be exactly
> the same through the eyes of this phone's WAP browser.  Something in the
> responses is different.  Even though the response headers are all the
> same I cannot get these two URLs to behave the same way.  Here are the
> headers for both (obviously with different dates):
>
> statusCode: 200
> statusLine: HTTP/1.1 200 OK
> statusText: OK
> responseCharSet: ISO-8859-1
> responseFooters:
> responseHeaders:
>    Date: Fri, 02 Dec 2005 19:13:24 GMT
>    Server: Jetty/5.1.5 (Linux/2.6.14-1.1637_FC4 i386 java/1.5.0_05
>    Content-Type: application/java-archive
>    Content-Length: 33603
>    Accept-Ranges: bytes
>    Last-Modified: Fri, 02 Dec 2005 19:13:24 GMT
>
> Ahh and from the Server header you can see that I'm using Jetty 5.1.5 on
> SUN JDK 1.5.0_05.  Any clue as to what is different in these responses?
> I'm totally perplexed.
>
> Thanks much,
> Alex
>
>
>
> -------------------------------------------------------
> This SF.net email is sponsored by: Splunk Inc. Do you grep through log
> files
> for problems?  Stop!  Download the new AJAX search engine that makes
> searching your log files as easy as surfing the  web.  DOWNLOAD SPLUNK!
> http://ads.osdn.com/?ad_id=7637&alloc_id=16865&op=click
> _______________________________________________
> Jetty-support mailing list
> [hidden email]
> https://lists.sourceforge.net/lists/listinfo/jetty-support
>



-------------------------------------------------------
This SF.net email is sponsored by: Splunk Inc. Do you grep through log files
for problems?  Stop!  Download the new AJAX search engine that makes
searching your log files as easy as surfing the  web.  DOWNLOAD SPLUNK!
http://ads.osdn.com/?ad_id=7637&alloc_id=16865&op=click
_______________________________________________
Jetty-support mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/jetty-support
Reply | Threaded
Open this post in threaded view
|

Re: Static vs. Dynamic content stream differences.

Alex Karasulu-4
Greg Wilkins wrote:

>Alex,
>
>i tried this with telnet and got:
>
>
>[514] telnet karasulu.homeip.net 80
>Trying 65.80.200.112...
>Connected to karasulu.homeip.net.
>Escape character is '^]'.
>GET /activation/test/ HTTP/1.0
>
>HTTP/1.1 200 OK
>Date: Mon, 05 Dec 2005 13:12:14 GMT
>Server: Jetty/5.1.5 (Linux/2.6.14-1.1637_FC4 i386 java/1.5.0_05
>Content-Type: text/text;charset=ISO-8859-1
>Content-Length: 50
>Connection: close
>
>No such safehaus account with activation key: testConnection closed by foreign host.
>
>
>for both requests???
>
>so I can't really tell??
>
>For the servlet, try mapping it to a URL that ends with .jar just to make
>sure the phone is not being dumb and doing it's own extension to mime-type mapping.
>  
>
Greg,

Just tried that and it worked like a champion.  The phone was in fact
not running off the content type but from the file extension.  How
retarded.  A friend from the list had recommended this too: thanks Guy!  
BTW sorry aout the URL not working the servlet must have changed.

Thanks again,
Alex



-------------------------------------------------------
This SF.net email is sponsored by: Splunk Inc. Do you grep through log files
for problems?  Stop!  Download the new AJAX search engine that makes
searching your log files as easy as surfing the  web.  DOWNLOAD SPLUNK!
http://ads.osdn.com/?ad_id=7637&alloc_id=16865&op=click
_______________________________________________
Jetty-support mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/jetty-support