You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@tomcat.apache.org by hardc0d3r <ha...@gmail.com> on 2007/08/24 13:30:23 UTC

how to add restriction to a folder?

i want to have a folder that will contain files that can be downloaded/saved
only by going through a servlet.. how can i do this? are there any tutorials
or links? thanks..
-- 
View this message in context: http://www.nabble.com/how-to-add-restriction-to-a-folder--tf4323046.html#a12310612
Sent from the Tomcat - User mailing list archive at Nabble.com.


---------------------------------------------------------------------
To start a new topic, e-mail: users@tomcat.apache.org
To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
For additional commands, e-mail: users-help@tomcat.apache.org


Re: how to add restriction to a folder?

Posted by David Smith <dn...@cornell.edu>.
Easy:

1. Store your download files in a folder inside of WEB-INF which is 
protected from /direct/ access by the client.
2. Grab a copy of the default servlet source and refactor it to your 
package modding as necessary to your needs.
3. Register the servlet in your web.xml mapping to some request path 
like /downloads/*

--David

hardc0d3r wrote:

>i want to have a folder that will contain files that can be downloaded/saved
>only by going through a servlet.. how can i do this? are there any tutorials
>or links? thanks..
>  
>


---------------------------------------------------------------------
To start a new topic, e-mail: users@tomcat.apache.org
To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
For additional commands, e-mail: users-help@tomcat.apache.org


Re: Open a session based on the session id

Posted by Ben Souther <be...@souther.us>.
I've never had to deal with the session id in my own code.
Both Firefox and MSIE send it automatically when I make AJAX calls.





192.168.000.029.02446-192.168.000.020.08080: POST 
Accept: text/javascript, text/html, application/xml, text/xml, */*
Accept-Language: en-us
x-prototype-version: 1.5.0
Referer: http://192.168.0.20:8080/myContext/myPage
x-requested-with: XMLHttpRequest
Content-Type: application/x-www-form-urlencoded; charset=UTF-8
UA-CPU: x86
Accept-Encoding: gzip, deflate
User-Agent: Mozilla/4.0 (compatible; MSIE 7.0; Windows NT 5.2; .NET CLR
1.1.4322)
Host: 192.168.0.20:8080
Content-Length: 36
Connection: Keep-Alive
Cache-Control: no-cache
Cookie: JSESSIONID=1C00A7251D7BF3EB3499EDC37614A93B <<<<=======<<<<<<
 
 
192.168.000.029.02446-192.168.000.020.08080: criteria=a














> Hernâni Henrique Ramos Cerqueira wrote:
> > Hello all,
> > I'm developing a webapp that does lots of ajax requests, but I need to
> > keep track of the session. Wath i do is to read the JSESSIONID cookie
> > with javascript and send the value as a POST parameter when I make the
> > request, but then tomcat doesn't open the session automaticaly. My
> > question is the following: Is there a way of calling the rigth session
> > based on the session id passed on the post parameter?
> > 
> > Thanks in advance,
> > Cheers, Hernâni
> > 
> > 
> > ---------------------------------------------------------------------
> > To start a new topic, e-mail: users@tomcat.apache.org
> > To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
> > For additional commands, e-mail: users-help@tomcat.apache.org
> > 
> -----BEGIN PGP SIGNATURE-----
> Version: GnuPG v1.4.7 (MingW32)
> Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org
> 
> iD8DBQFGzuXn9CaO5/Lv0PARAq+XAKCMPau4Sei6eR5etAR40Y1ijfcNawCfa+e8
> mxdcstbA6kTnokVMr7iiFQM=
> =ZbeP
> -----END PGP SIGNATURE-----
> 
> ---------------------------------------------------------------------
> To start a new topic, e-mail: users@tomcat.apache.org
> To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
> For additional commands, e-mail: users-help@tomcat.apache.org


---------------------------------------------------------------------
To start a new topic, e-mail: users@tomcat.apache.org
To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
For additional commands, e-mail: users-help@tomcat.apache.org


Re: Open a session based on the session id

Posted by Hernâni Henrique Ramos Cerqueira <hr...@gmail.com>.
Sex, 2007-08-24 às 10:06 -0400, Christopher Schultz escreveu:
> -----BEGIN PGP SIGNED MESSAGE-----
> Hash: SHA1
> 
> Hernâni,
> 
> Don't hijack threads. Please post a new question.

???
> 
> - -chris
> 
> Hernâni Henrique Ramos Cerqueira wrote:
> > Hello all,
> > I'm developing a webapp that does lots of ajax requests, but I need to
> > keep track of the session. Wath i do is to read the JSESSIONID cookie
> > with javascript and send the value as a POST parameter when I make the
> > request, but then tomcat doesn't open the session automaticaly. My
> > question is the following: Is there a way of calling the rigth session
> > based on the session id passed on the post parameter?
> > 
> > Thanks in advance,
> > Cheers, Hernâni
> > 
> > 
> > ---------------------------------------------------------------------
> > To start a new topic, e-mail: users@tomcat.apache.org
> > To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
> > For additional commands, e-mail: users-help@tomcat.apache.org
> > 
> -----BEGIN PGP SIGNATURE-----
> Version: GnuPG v1.4.7 (MingW32)
> Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org
> 
> iD8DBQFGzuXn9CaO5/Lv0PARAq+XAKCMPau4Sei6eR5etAR40Y1ijfcNawCfa+e8
> mxdcstbA6kTnokVMr7iiFQM=
> =ZbeP
> -----END PGP SIGNATURE-----
> 
> ---------------------------------------------------------------------
> To start a new topic, e-mail: users@tomcat.apache.org
> To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
> For additional commands, e-mail: users-help@tomcat.apache.org
> 


---------------------------------------------------------------------
To start a new topic, e-mail: users@tomcat.apache.org
To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
For additional commands, e-mail: users-help@tomcat.apache.org


Re: Open a session based on the session id

Posted by Christopher Schultz <ch...@christopherschultz.net>.
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

Hernâni,

Don't hijack threads. Please post a new question.

- -chris

Hernâni Henrique Ramos Cerqueira wrote:
> Hello all,
> I'm developing a webapp that does lots of ajax requests, but I need to
> keep track of the session. Wath i do is to read the JSESSIONID cookie
> with javascript and send the value as a POST parameter when I make the
> request, but then tomcat doesn't open the session automaticaly. My
> question is the following: Is there a way of calling the rigth session
> based on the session id passed on the post parameter?
> 
> Thanks in advance,
> Cheers, Hernâni
> 
> 
> ---------------------------------------------------------------------
> To start a new topic, e-mail: users@tomcat.apache.org
> To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
> For additional commands, e-mail: users-help@tomcat.apache.org
> 
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.7 (MingW32)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org

iD8DBQFGzuXn9CaO5/Lv0PARAq+XAKCMPau4Sei6eR5etAR40Y1ijfcNawCfa+e8
mxdcstbA6kTnokVMr7iiFQM=
=ZbeP
-----END PGP SIGNATURE-----

---------------------------------------------------------------------
To start a new topic, e-mail: users@tomcat.apache.org
To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
For additional commands, e-mail: users-help@tomcat.apache.org


Open a session based on the session id

Posted by Hernâni Henrique Ramos Cerqueira <hr...@gmail.com>.
Hello all,
I'm developing a webapp that does lots of ajax requests, but I need to
keep track of the session. Wath i do is to read the JSESSIONID cookie
with javascript and send the value as a POST parameter when I make the
request, but then tomcat doesn't open the session automaticaly. My
question is the following: Is there a way of calling the rigth session
based on the session id passed on the post parameter?

Thanks in advance,
Cheers, Hernâni


---------------------------------------------------------------------
To start a new topic, e-mail: users@tomcat.apache.org
To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
For additional commands, e-mail: users-help@tomcat.apache.org